William Petit
2edd795ab8
All checks were successful
Cadoles/bouncer/pipeline/pr-develop This commit looks good
28 lines
769 B
Go
28 lines
769 B
Go
package config
|
|
|
|
import "time"
|
|
|
|
const (
|
|
RedisModeSimple = "simple"
|
|
RedisModeSentinel = "sentinel"
|
|
RedisModeCluster = "cluster"
|
|
)
|
|
|
|
type RedisConfig struct {
|
|
Adresses InterpolatedStringSlice `yaml:"addresses"`
|
|
Master InterpolatedString `yaml:"master"`
|
|
ReadTimeout InterpolatedDuration `yaml:"readTimeout"`
|
|
WriteTimeout InterpolatedDuration `yaml:"writeTimeout"`
|
|
DialTimeout InterpolatedDuration `yaml:"dialTimeout"`
|
|
}
|
|
|
|
func NewDefaultRedisConfig() RedisConfig {
|
|
return RedisConfig{
|
|
Adresses: InterpolatedStringSlice{"localhost:6379"},
|
|
Master: "",
|
|
ReadTimeout: InterpolatedDuration(30 * time.Second),
|
|
WriteTimeout: InterpolatedDuration(30 * time.Second),
|
|
DialTimeout: InterpolatedDuration(30 * time.Second),
|
|
}
|
|
}
|