redis.go 652 B

123456789
  1. package config
  2. type Redis struct {
  3. Addr string `mapstructure:"addr" json:"addr" yaml:"addr"` // 服务器地址:端口
  4. Password string `mapstructure:"password" json:"password" yaml:"password"` // 密码
  5. DB int `mapstructure:"db" json:"db" yaml:"db"` // 单实例模式下redis的哪个数据库
  6. UseCluster bool `mapstructure:"useCluster" json:"useCluster" yaml:"useCluster"` // 是否使用集群模式
  7. ClusterAddrs []string `mapstructure:"clusterAddrs" json:"clusterAddrs" yaml:"clusterAddrs"` // 集群模式下的节点地址列表
  8. }