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.
 
 
 

97 lines
2.8 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. MqWorkQueueName string `yaml:"mq_work_queue_name"`
  12. RabbitMqAddr string `yaml:"rabbitMq_addr"`
  13. RabbitMqAddrTest string `yaml:"rabbitMq_addr_test"`
  14. DB DBCfg `yaml:"db"`
  15. MQ MQCfg `yaml:"mq"`
  16. ES ESCfg `yaml:"es"`
  17. Log LogCfg `yaml:"log"`
  18. ArkID ArkIDCfg `yaml:"arkid"`
  19. Admin AdminCfg `yaml:"admin"`
  20. Official OfficialCfg `yaml:"official"`
  21. WxappletFilepath WxappletFilepathCfg `yaml:"wxapplet_filepath"`
  22. Local bool
  23. AppComm AppCommCfg `yaml:"app_comm"`
  24. }
  25. // 公共模块
  26. type AppCommCfg struct {
  27. URL string `yaml:"url"`
  28. }
  29. // OfficialCfg is 官网
  30. type OfficialCfg struct {
  31. URL string `yaml:"url"`
  32. }
  33. type WxappletFilepathCfg struct {
  34. URL string `yaml:"url"`
  35. }
  36. // AdminCfg is 后台接口调用需要
  37. type AdminCfg struct {
  38. URL string `yaml:"url"`
  39. IURL string `yaml:"iurl"`
  40. AesKey string `yaml:"api_aes_key"`
  41. AesIV string `yaml:"api_aes_iv"`
  42. Host string `yaml:"host"`
  43. }
  44. type ArkIDCfg struct {
  45. Admin string `yaml:"admin"`
  46. AdminPassword string `yaml:"admin_password"`
  47. Url string `yaml:"url`
  48. }
  49. //数据库配置结构体
  50. type DBCfg struct {
  51. Host string `yaml:"host"` //ip及端口
  52. Name string `yaml:"name"` //库名
  53. User string `yaml:"user"` //用户
  54. Psw string `yaml:"psw"` //密码
  55. ShowLog bool `yaml:"show_log"` //是否显示SQL语句
  56. MaxLifetime time.Duration `yaml:"max_lifetime"`
  57. MaxOpenConns int `yaml:"max_open_conns"`
  58. MaxIdleConns int `yaml:"max_idle_conns"`
  59. Path string `yaml:"path"` //日志文件存放路径
  60. }
  61. type MQCfg struct {
  62. Host string `yaml:"host"`
  63. Port string `yaml:"port"`
  64. User string `yaml:"user"`
  65. Pwd string `yaml:"pwd"`
  66. }
  67. type ESCfg struct {
  68. Url string `yaml:"url"`
  69. User string `yaml:"user"`
  70. Pwd string `yaml:"pwd"`
  71. }
  72. //日志配置结构体
  73. type LogCfg struct {
  74. AppName string `yaml:"app_name" `
  75. Level string `yaml:"level"`
  76. IsStdOut bool `yaml:"is_stdout"`
  77. TimeFormat string `yaml:"time_format"` // second, milli, nano, standard, iso,
  78. Encoding string `yaml:"encoding"` // console, json
  79. IsFileOut bool `yaml:"is_file_out"`
  80. FileDir string `yaml:"file_dir"`
  81. FileName string `yaml:"file_name"`
  82. FileMaxSize int `yaml:"file_max_size"`
  83. FileMaxAge int `yaml:"file_max_age"`
  84. }