Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckRedis ¶
func CheckRedis(ctx context.Context, config *RedisConfig) error
CheckRedis checks the Redis connection.
func ValidateAddress ¶
validateAddress checks the format of the given Redis address.
Types ¶
type RedisClient ¶
RedisClientInterface defines the behavior of a Redis client. This interface can be implemented by any Redis client, facilitating testing and different implementations. RedisClient represents a Redis client, providing an interface for operations.
func NewRedisClient ¶
func NewRedisClient(ctx context.Context, config *RedisConfig) (RedisClient, error)
type RedisConfig ¶
type RedisConfig struct { ClusterMode bool // Whether to use Redis in cluster mode. Address []string // List of Redis server addresses (host:port). Username string // Username for Redis authentication (Redis 6 ACL). Password string // Password for Redis authentication. EnablePipeline bool // Enable pipelining of commands for efficiency. MaxRetries int // Maximum number of retries for a command. DB int // Database number to connect to, for non-cluster mode. PoolSize int // Number of connections to pool. ConnectionTimeout time.Duration // Timeout for connecting to Redis servers. }
RedisConfig defines the configuration parameters for a Redis client, including options for both single-node and cluster mode connections.
Click to show internal directories.
Click to hide internal directories.