劲创营---任务项目
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 3 nedēļām
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. DB DBCfg `yaml:"db"`
  12. Log LogCfg `yaml:"log"`
  13. ArkID ArkIDCfg `yaml:"arkid"`
  14. Admin AdminCfg `yaml:"admin"`
  15. ImBusinessRpc ImBusinessRpcCfg `yaml:"im_business_rpc"`
  16. ImLogicRpc ImLogicRpcCfg `yaml:"im_logic_rpc"`
  17. App AppCfg `yaml:"app"`
  18. Official OfficialCfg `yaml:"official"`
  19. WxappletFilepath WxappletFilepathCfg `yaml:"wxapplet_filepath"`
  20. Local bool
  21. AppComm AppCommCfg `yaml:"app_comm"`
  22. ZhiosPay ZhiosPayCfg `yaml:"zhios_pay"`
  23. MQ MQCfg `yaml:"mq"`
  24. ZhimengDB DBCfg `yaml:"zhimeng_db"`
  25. }
  26. type ZhiosPayCfg struct {
  27. URL string `yaml:"url"`
  28. }
  29. type AppCfg 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. }
  46. type ImBusinessRpcCfg struct {
  47. URL string `yaml:"url"`
  48. PORT string `yaml:"port"`
  49. }
  50. type ImLogicRpcCfg struct {
  51. URL string `yaml:"url"`
  52. PORT string `yaml:"port"`
  53. }
  54. type AppCommCfg struct {
  55. OuterURL string `yaml:"outer_url"` // 本模块外部地址
  56. }
  57. type ArkIDCfg struct {
  58. Admin string `yaml:"admin"`
  59. AdminPassword string `yaml:"admin_password"`
  60. Url string `yaml:"url"`
  61. }
  62. // 数据库配置结构体
  63. type DBCfg struct {
  64. Host string `yaml:"host"` //ip及端口
  65. Name string `yaml:"name"` //库名
  66. User string `yaml:"user"` //用户
  67. Psw string `yaml:"psw"` //密码
  68. ShowLog bool `yaml:"show_log"` //是否显示SQL语句
  69. MaxLifetime time.Duration `yaml:"max_lifetime"`
  70. MaxOpenConns int `yaml:"max_open_conns"`
  71. MaxIdleConns int `yaml:"max_idle_conns"`
  72. Path string `yaml:"path"` //日志文件存放路径
  73. }
  74. // 日志配置结构体
  75. type LogCfg struct {
  76. AppName string `yaml:"app_name" `
  77. Level string `yaml:"level"`
  78. IsStdOut bool `yaml:"is_stdout"`
  79. TimeFormat string `yaml:"time_format"` // second, milli, nano, standard, iso,
  80. Encoding string `yaml:"encoding"` // console, json
  81. IsFileOut bool `yaml:"is_file_out"`
  82. FileDir string `yaml:"file_dir"`
  83. FileName string `yaml:"file_name"`
  84. FileMaxSize int `yaml:"file_max_size"`
  85. FileMaxAge int `yaml:"file_max_age"`
  86. }
  87. type MQCfg struct {
  88. Host string `yaml:"host"`
  89. Port string `yaml:"port"`
  90. User string `yaml:"user"`
  91. Pwd string `yaml:"pwd"`
  92. }