golang 的 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.

cfg_app.go 3.2 KiB

2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. package cfg
  2. import (
  3. "time"
  4. )
  5. type Config struct {
  6. Debug bool `yaml:"debug"`
  7. Prd bool `yaml:"prd"`
  8. CurlDebug bool `yaml:"curldebug"`
  9. SrvAddr string `yaml:"srv_addr"`
  10. RedisAddr string `yaml:"redis_addr"`
  11. RabbitMqAddr string `yaml:"rabbitMq_addr"`
  12. RabbitMqAddrTest string `yaml:"rabbitMq_addr_test"`
  13. DB DBCfg `yaml:"db"`
  14. DataDB DBCfg `yaml:"data_db"`
  15. ImDB DBCfg `yaml:"im_db"`
  16. MQ MQCfg `yaml:"mq"`
  17. ES ESCfg `yaml:"es"`
  18. Log LogCfg `yaml:"log"`
  19. ArkID ArkIDCfg `yaml:"arkid"`
  20. Admin AdminCfg `yaml:"admin"`
  21. ImBusinessRpc ImBusinessRpcCfg `yaml:"im_business_rpc"`
  22. ImLogicRpc ImLogicRpcCfg `yaml:"im_logic_rpc"`
  23. Official OfficialCfg `yaml:"official"`
  24. WxappletFilepath WxappletFilepathCfg `yaml:"wxapplet_filepath"`
  25. Local bool
  26. AppComm AppCommCfg `yaml:"app_comm"`
  27. }
  28. // 公共模块
  29. type AppCommCfg struct {
  30. URL string `yaml:"url"`
  31. }
  32. // OfficialCfg is 官网
  33. type OfficialCfg struct {
  34. URL string `yaml:"url"`
  35. }
  36. type WxappletFilepathCfg struct {
  37. URL string `yaml:"url"`
  38. }
  39. // AdminCfg is 后台接口调用需要
  40. type AdminCfg struct {
  41. URL string `yaml:"url"`
  42. IURL string `yaml:"iurl"`
  43. AesKey string `yaml:"api_aes_key"`
  44. AesIV string `yaml:"api_aes_iv"`
  45. Host string `yaml:"host"`
  46. }
  47. type ArkIDCfg struct {
  48. Admin string `yaml:"admin"`
  49. AdminPassword string `yaml:"admin_password"`
  50. Url string `yaml:"url`
  51. }
  52. //数据库配置结构体
  53. type DBCfg struct {
  54. Host string `yaml:"host"` //ip及端口
  55. Name string `yaml:"name"` //库名
  56. User string `yaml:"user"` //用户
  57. Psw string `yaml:"psw"` //密码
  58. ShowLog bool `yaml:"show_log"` //是否显示SQL语句
  59. MaxLifetime time.Duration `yaml:"max_lifetime"`
  60. MaxOpenConns int `yaml:"max_open_conns"`
  61. MaxIdleConns int `yaml:"max_idle_conns"`
  62. Path string `yaml:"path"` //日志文件存放路径
  63. }
  64. type MQCfg struct {
  65. Host string `yaml:"host"`
  66. Port string `yaml:"port"`
  67. User string `yaml:"user"`
  68. Pwd string `yaml:"pwd"`
  69. }
  70. type ESCfg struct {
  71. Url string `yaml:"url"`
  72. User string `yaml:"user"`
  73. Pwd string `yaml:"pwd"`
  74. }
  75. //日志配置结构体
  76. type LogCfg struct {
  77. AppName string `yaml:"app_name" `
  78. Level string `yaml:"level"`
  79. IsStdOut bool `yaml:"is_stdout"`
  80. TimeFormat string `yaml:"time_format"` // second, milli, nano, standard, iso,
  81. Encoding string `yaml:"encoding"` // console, json
  82. IsFileOut bool `yaml:"is_file_out"`
  83. FileDir string `yaml:"file_dir"`
  84. FileName string `yaml:"file_name"`
  85. FileMaxSize int `yaml:"file_max_size"`
  86. FileMaxAge int `yaml:"file_max_age"`
  87. }
  88. type ImBusinessRpcCfg struct {
  89. URL string `yaml:"url"`
  90. PORT string `yaml:"port"`
  91. }
  92. type ImLogicRpcCfg struct {
  93. URL string `yaml:"url"`
  94. PORT string `yaml:"port"`
  95. }