config.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. // Copyright 2019 getensh.com. All rights reserved.
  2. // Use of this source code is governed by getensh.com.
  3. package config
  4. type LogConfig struct {
  5. Path string
  6. Level string
  7. MaxSize int
  8. MaxBackups int
  9. MaxAge int
  10. Stacktrace bool
  11. }
  12. type WxNode struct {
  13. AppletAppId string
  14. AppletAppSecret string
  15. AppletNotifyUrl string
  16. AppletMchId string
  17. AppletAppKey string
  18. PublicAppId string
  19. PublicAppSecret string
  20. MerchantMchID string
  21. MerchantMchCertificateSerialNumber string
  22. MerchantMchAPIv3Key string
  23. MerchantMchPrivateKey string
  24. PublicStateMsgTmpId string
  25. }
  26. type MysqlConfig struct {
  27. User string
  28. Password string
  29. Addr string
  30. DB string
  31. Charset string
  32. MaxIdle int
  33. MaxConn int
  34. LogMode bool
  35. }
  36. type RedisConfig struct {
  37. Addrs []string
  38. Password string
  39. DB int
  40. PoolSize int
  41. MinIdleConns int
  42. MaxRetries int
  43. Cluster bool
  44. }
  45. type ElasticConfig struct {
  46. Addrs []string
  47. Sniff bool
  48. }
  49. type ThirdPartNode struct {
  50. Host string
  51. AppKey string
  52. AppSecret string
  53. }
  54. type AliPartNode struct {
  55. AesKey string
  56. }
  57. type ThirdPartyConfig struct {
  58. Ali AliPartNode
  59. Wx WxNode
  60. }
  61. type RPCNode struct {
  62. ServiceName string
  63. ServicePort int
  64. ServiceIp string
  65. MysqlDb string
  66. RedisDb int
  67. LogLevel string
  68. LogStacktrace bool
  69. }
  70. type KeepaliveConfig struct {
  71. ClientTime int
  72. ClientTimeout int
  73. ServerTime int
  74. ServerTimeout int
  75. ServerMiniTime int
  76. }
  77. type OssConfig struct {
  78. BrandImage string
  79. SeriesImage string
  80. AccessKeyId string
  81. AccessKeySecret string
  82. Endpoint string
  83. Bucket string
  84. AvatarBucket string
  85. IconBucket string
  86. Protocol string
  87. FixBucket string
  88. RentObj string
  89. VoteObj string
  90. EventObj string
  91. }
  92. type Coupon struct {
  93. Url string
  94. Action string
  95. ExpireDate string
  96. }
  97. type RPCConfig struct {
  98. Prefix string
  99. Keepalive KeepaliveConfig
  100. Household RPCNode
  101. Garden RPCNode
  102. Thirdparty RPCNode
  103. System RPCNode
  104. Device RPCNode
  105. Common RPCNode
  106. }
  107. type Configure struct {
  108. // 基础配置
  109. K8s bool
  110. RunMode string
  111. Log LogConfig
  112. // 按需配置
  113. Mysql MysqlConfig
  114. Redis RedisConfig
  115. Elastic ElasticConfig
  116. ThirdParty ThirdPartyConfig
  117. Oss OssConfig
  118. // 所要启用的服务
  119. Rpc RPCConfig
  120. GateKey string
  121. EtcdAddrs []string
  122. }