diff options
author | Valery Piashchynski <[email protected]> | 2020-12-21 14:24:45 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-21 14:24:45 +0300 |
commit | 8543980775e5f8b12e5e200a0764052cdb4350a5 (patch) | |
tree | c1c6dff8e6bd81bcf51d608c5ed935702911ae81 /plugins/redis/config.go | |
parent | fd6e9cc403fc0c3857dcf29768429a374bd85636 (diff) | |
parent | 7b32b6b93576ec72b4b7fdf2068e655f869e9cf8 (diff) |
Merge pull request #453 from spiral/plugin/redis
Plugin/redis
Diffstat (limited to 'plugins/redis/config.go')
-rw-r--r-- | plugins/redis/config.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/plugins/redis/config.go b/plugins/redis/config.go new file mode 100644 index 00000000..ebcefed1 --- /dev/null +++ b/plugins/redis/config.go @@ -0,0 +1,32 @@ +package redis + +import "time" + +type Config struct { + Addrs []string `yaml:"addrs"` + DB int `yaml:"db"` + Username string `yaml:"username"` + Password string `yaml:"password"` + MasterName string `yaml:"master_name"` + SentinelPassword string `yaml:"sentinel_password"` + RouteByLatency bool `yaml:"route_by_latency"` + RouteRandomly bool `yaml:"route_randomly"` + MaxRetries int `yaml:"max_retries"` + DialTimeout time.Duration `yaml:"dial_timeout"` + MinRetryBackoff time.Duration `yaml:"min_retry_backoff"` + MaxRetryBackoff time.Duration `yaml:"max_retry_backoff"` + PoolSize int `yaml:"pool_size"` + MinIdleConns int `yaml:"min_idle_conns"` + MaxConnAge time.Duration `yaml:"max_conn_age"` + ReadTimeout time.Duration `yaml:"read_timeout"` + WriteTimeout time.Duration `yaml:"write_timeout"` + PoolTimeout time.Duration `yaml:"pool_timeout"` + IdleTimeout time.Duration `yaml:"idle_timeout"` + IdleCheckFreq time.Duration `yaml:"idle_check_freq"` + ReadOnly bool `yaml:"read_only"` +} + +// InitDefaults initializing fill config with default values +func (s *Config) InitDefaults() { + s.Addrs = []string{"localhost:6379"} // default addr is pointing to local storage +} |