蛋蛋星球RabbitMq消费项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

62 lines
1.9 KiB

  1. package cfg
  2. import (
  3. "time"
  4. )
  5. type Config struct {
  6. CurlDebug bool `yaml:"curldebug"`
  7. Debug bool `yaml:"debug"`
  8. Prd bool `yaml:"prd"`
  9. RedisAddr string `yaml:"redis_addr"`
  10. RedisPassword string `yaml:"redis_password"`
  11. DB DBCfg `yaml:"db"`
  12. ImDB DBCfg `yaml:"im_db"`
  13. MQ MQCfg `yaml:"mq"`
  14. Log LogCfg `yaml:"log"`
  15. ImBusinessRpc ImBusinessRpcCfg `yaml:"im_business_rpc"`
  16. ImLogicRpc ImLogicRpcCfg `yaml:"im_logic_rpc"`
  17. ES ESCfg `yaml:"es"`
  18. }
  19. // 数据库配置结构体
  20. type DBCfg struct {
  21. Host string `yaml:"host"` //ip及端口
  22. Name string `yaml:"name"` //库名
  23. User string `yaml:"user"` //用户
  24. Psw string `yaml:"psw"` //密码
  25. ShowLog bool `yaml:"show_log"` //是否显示SQL语句
  26. MaxLifetime time.Duration `yaml:"max_lifetime"`
  27. MaxOpenConns int `yaml:"max_open_conns"`
  28. MaxIdleConns int `yaml:"max_idle_conns"`
  29. Path string `yaml:"path"` //日志文件存放路径
  30. }
  31. // 日志配置结构体
  32. type LogCfg struct {
  33. AppName string `yaml:"app_name" `
  34. Level string `yaml:"level"`
  35. IsStdOut bool `yaml:"is_stdout"`
  36. TimeFormat string `yaml:"time_format"` // second, milli, nano, standard, iso,
  37. Encoding string `yaml:"encoding"` // console, json
  38. IsFileOut bool `yaml:"is_file_out"`
  39. FileDir string `yaml:"file_dir"`
  40. FileName string `yaml:"file_name"`
  41. FileMaxSize int `yaml:"file_max_size"`
  42. FileMaxAge int `yaml:"file_max_age"`
  43. }
  44. type MQCfg struct {
  45. Host string `yaml:"host"`
  46. Port string `yaml:"port"`
  47. User string `yaml:"user"`
  48. Pwd string `yaml:"pwd"`
  49. }
  50. type ESCfg struct {
  51. Url string `yaml:"url"`
  52. User string `yaml:"user"`
  53. Pwd string `yaml:"pwd"`
  54. }