Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotConfigured = errors.New("Redis is not configured")
Functions ¶
func GetRedisClient ¶
func GetRedisClient(conf *RedisConfig) (redis.UniversalClient, error)
Types ¶
type RedisConfig ¶
type RedisConfig struct {
Address string `yaml:"address"`
Username string `yaml:"username"`
Password string `yaml:"password"`
DB int `yaml:"db"`
UseTLS bool `yaml:"use_tls"`
MasterName string `yaml:"sentinel_master_name"`
SentinelUsername string `yaml:"sentinel_username"`
SentinelPassword string `yaml:"sentinel_password"`
SentinelAddresses []string `yaml:"sentinel_addresses"`
ClusterAddresses []string `yaml:"cluster_addresses"`
DialTimeout int `yaml:"dial_timeout"`
ReadTimeout int `yaml:"read_timeout"`
WriteTimeout int `yaml:"write_timeout"`
// for clustererd mode only, number of redirects to follow, defaults to 2
MaxRedirects *int `yaml:"max_redirects"`
}
func (*RedisConfig) GetMaxRedirects ¶ added in v1.4.0
func (r *RedisConfig) GetMaxRedirects() int
func (*RedisConfig) IsConfigured ¶ added in v1.2.4
func (r *RedisConfig) IsConfigured() bool
Click to show internal directories.
Click to hide internal directories.