Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRedisURL ¶ added in v0.7.41
parseRedisURL parses a Redis URL into Redis options, handling various URL formats including Azure Redis Cache URLs with special characters in passwords.
Types ¶
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Redis struct holds the Redis client and addresses of Redis instances. It supports both single-instance Redis connections and Redis Cluster setups.
func NewRedisClient ¶
NewRedisClient creates a new Redis client connection based on the provided list of addresses. It automatically detects if the connection is for a single Redis instance or a Redis Cluster.
Parameters: - addresses []string: A list of Redis addresses. For a single Redis instance, provide one address. - skipTLSVerify bool: Whether to skip TLS certificate verification
Returns: - *Redis: A new Redis client wrapper. - error: An error if the provided address is invalid or connection setup fails.
func (*Redis) Client ¶
func (r *Redis) Client() redis.UniversalClient
Client returns the Redis universal client. It can be used directly for Redis operations like Get, Set, or Publish.
Returns: - redis.UniversalClient: The universal Redis client, which supports both standalone and clustered Redis instances.
func (*Redis) MakeRedisClient ¶
func (r *Redis) MakeRedisClient() interface{}
MakeRedisClient returns the Redis client interface, allowing compatibility with other packages or tools.
Returns: - interface{}: The Redis client interface.