db_redis.go 1.8 KB

123456789101112131415161718192021222324252627282930
  1. package config
  2. type Redis struct {
  3. Addr string `mapstructure:"addr" json:"addr" yaml:"addr"` // url
  4. Password string `mapstructure:"password" json:"password" yaml:"password"` // 密码
  5. Db int `mapstructure:"db" json:"db" yaml:"db"` // index db
  6. EnabledTls bool `mapstructure:"enabledTls" json:"enabledTls" yaml:"enabledTls"` // 是否 启用tls
  7. EnabledCluster bool `mapstructure:"enabledCluster" json:"enabledCluster" yaml:"enabledCluster"` // 是否集群
  8. Cluster []string `mapstructure:"cluster" json:"cluster" yaml:"cluster"`
  9. }
  10. type RedisMq struct {
  11. Addr string `mapstructure:"addr" json:"addr" yaml:"addr"` // url
  12. Password string `mapstructure:"password" json:"password" yaml:"password"` // 密码
  13. Db int `mapstructure:"db" json:"db" yaml:"db"` // index db
  14. EnabledTls bool `mapstructure:"enabledTls" json:"enabledTls" yaml:"enabledTls"` // 是否 启用tls
  15. EnabledCluster bool `mapstructure:"enabledCluster" json:"enabledCluster" yaml:"enabledCluster"` // 是否集群
  16. Cluster []string `mapstructure:"cluster" json:"cluster" yaml:"cluster"`
  17. Consumer *Consumer `mapstructure:"consumer" json:"consumer" yaml:"consumer"`
  18. }
  19. type Consumer struct {
  20. Concurrency int `mapstructure:"concurrency" json:"concurrency" yaml:"concurrency"`
  21. Queues []*Queue `mapstructure:"queues" json:"queues" yaml:"queues"`
  22. }
  23. type Queue struct {
  24. Name string `mapstructure:"name" json:"name" yaml:"name"`
  25. Priority int `mapstructure:"priority" json:"priority" yaml:"priority"`
  26. }