Documentation ¶
Index ¶
- Variables
- func CreateClusterRedisClient(conf *RedisConfig) (cli *redis.ClusterClient, err error)
- func CreateSingleReidsClient(conf *RedisConfig) (cli *redis.Client, err error)
- func InitClusterRedisClient(rcs []RedisConfig) (err error)
- func InitSingleRedisClient(rcs []RedisConfig) (err error)
- type RedisConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var RedisClusterClients map[string]*redis.ClusterClient
View Source
var RedisSingleClients map[string]*redis.Client
Functions ¶
func CreateClusterRedisClient ¶
func CreateClusterRedisClient(conf *RedisConfig) (cli *redis.ClusterClient, err error)
func CreateSingleReidsClient ¶
func CreateSingleReidsClient(conf *RedisConfig) (cli *redis.Client, err error)
func InitClusterRedisClient ¶
func InitClusterRedisClient(rcs []RedisConfig) (err error)
func InitSingleRedisClient ¶
func InitSingleRedisClient(rcs []RedisConfig) (err error)
Types ¶
type RedisConfig ¶
type RedisConfig struct { ProxyName string `json:"proxy_name"` Username string Password string Addrs []string Database int IsCluster bool `json:"is_cluster"` // todo 根据 redis.ClusterOptions 的配置项添加 DialTimeout int `json:"dial_timeout"` ReadTimeout int `json:"read_timeout"` WriteTimeout int `json:"write_timeout"` MaxRetries int `json:"max_retries"` PoolSize int `json:"pool_size"` IdleTimeout int `json:"idle_timeout"` IdleCheckFrequency int `json:"idle_check_frequency"` }
Click to show internal directories.
Click to hide internal directories.