golang 的 rabbitmq 消费项目
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

111 linhas
3.2 KiB

  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. ZhimengDB DBCfg `yaml:"zhimeng_db"`
  28. }
  29. // 公共模块
  30. type AppCommCfg struct {
  31. URL string `yaml:"url"`
  32. }
  33. // OfficialCfg is 官网
  34. type OfficialCfg struct {
  35. URL string `yaml:"url"`
  36. }
  37. type WxappletFilepathCfg struct {
  38. URL string `yaml:"url"`
  39. }
  40. // AdminCfg is 后台接口调用需要
  41. type AdminCfg struct {
  42. URL string `yaml:"url"`
  43. IURL string `yaml:"iurl"`
  44. AesKey string `yaml:"api_aes_key"`
  45. AesIV string `yaml:"api_aes_iv"`
  46. Host string `yaml:"host"`
  47. }
  48. type ArkIDCfg struct {
  49. Admin string `yaml:"admin"`
  50. AdminPassword string `yaml:"admin_password"`
  51. Url string `yaml:"url`
  52. }
  53. //数据库配置结构体
  54. type DBCfg struct {
  55. Host string `yaml:"host"` //ip及端口
  56. Name string `yaml:"name"` //库名
  57. User string `yaml:"user"` //用户
  58. Psw string `yaml:"psw"` //密码
  59. ShowLog bool `yaml:"show_log"` //是否显示SQL语句
  60. MaxLifetime time.Duration `yaml:"max_lifetime"`
  61. MaxOpenConns int `yaml:"max_open_conns"`
  62. MaxIdleConns int `yaml:"max_idle_conns"`
  63. Path string `yaml:"path"` //日志文件存放路径
  64. }
  65. type MQCfg struct {
  66. Host string `yaml:"host"`
  67. Port string `yaml:"port"`
  68. User string `yaml:"user"`
  69. Pwd string `yaml:"pwd"`
  70. }
  71. type ESCfg struct {
  72. Url string `yaml:"url"`
  73. User string `yaml:"user"`
  74. Pwd string `yaml:"pwd"`
  75. }
  76. //日志配置结构体
  77. type LogCfg struct {
  78. AppName string `yaml:"app_name" `
  79. Level string `yaml:"level"`
  80. IsStdOut bool `yaml:"is_stdout"`
  81. TimeFormat string `yaml:"time_format"` // second, milli, nano, standard, iso,
  82. Encoding string `yaml:"encoding"` // console, json
  83. IsFileOut bool `yaml:"is_file_out"`
  84. FileDir string `yaml:"file_dir"`
  85. FileName string `yaml:"file_name"`
  86. FileMaxSize int `yaml:"file_max_size"`
  87. FileMaxAge int `yaml:"file_max_age"`
  88. }
  89. type ImBusinessRpcCfg struct {
  90. URL string `yaml:"url"`
  91. PORT string `yaml:"port"`
  92. }
  93. type ImLogicRpcCfg struct {
  94. URL string `yaml:"url"`
  95. PORT string `yaml:"port"`
  96. }