蛋蛋星球RabbitMq消费项目
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

73 lines
2.3 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. BackUpDb BackUpDBCfg `yaml:"db_back"`
  14. MQ MQCfg `yaml:"mq"`
  15. Log LogCfg `yaml:"log"`
  16. ImBusinessRpc ImBusinessRpcCfg `yaml:"im_business_rpc"`
  17. ImLogicRpc ImLogicRpcCfg `yaml:"im_logic_rpc"`
  18. ES ESCfg `yaml:"es"`
  19. }
  20. // 数据库配置结构体
  21. type DBCfg struct {
  22. Host string `yaml:"host"` //ip及端口
  23. Name string `yaml:"name"` //库名
  24. User string `yaml:"user"` //用户
  25. Psw string `yaml:"psw"` //密码
  26. ShowLog bool `yaml:"show_log"` //是否显示SQL语句
  27. MaxLifetime time.Duration `yaml:"max_lifetime"`
  28. MaxOpenConns int `yaml:"max_open_conns"`
  29. MaxIdleConns int `yaml:"max_idle_conns"`
  30. Path string `yaml:"path"` //日志文件存放路径
  31. }
  32. // 数据库配置结构体
  33. type BackUpDBCfg struct {
  34. Host string `yaml:"host"` //ip及端口
  35. Name string `yaml:"name"` //库名
  36. User string `yaml:"user"` //用户
  37. Psw string `yaml:"psw"` //密码
  38. ShowLog bool `yaml:"show_log"` //是否显示SQL语句
  39. Path string `yaml:"path"` //日志文件存放路径
  40. }
  41. // 日志配置结构体
  42. type LogCfg struct {
  43. AppName string `yaml:"app_name" `
  44. Level string `yaml:"level"`
  45. IsStdOut bool `yaml:"is_stdout"`
  46. TimeFormat string `yaml:"time_format"` // second, milli, nano, standard, iso,
  47. Encoding string `yaml:"encoding"` // console, json
  48. IsFileOut bool `yaml:"is_file_out"`
  49. FileDir string `yaml:"file_dir"`
  50. FileName string `yaml:"file_name"`
  51. FileMaxSize int `yaml:"file_max_size"`
  52. FileMaxAge int `yaml:"file_max_age"`
  53. }
  54. type MQCfg struct {
  55. Host string `yaml:"host"`
  56. Port string `yaml:"port"`
  57. User string `yaml:"user"`
  58. Pwd string `yaml:"pwd"`
  59. }
  60. type ESCfg struct {
  61. Url string `yaml:"url"`
  62. User string `yaml:"user"`
  63. Pwd string `yaml:"pwd"`
  64. }