config.go 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. // Copyright 2019 github.com. All rights reserved.
  2. // Use of this source code is governed by github.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 MysqlConfig struct {
  13. User string
  14. Password string
  15. Addr string
  16. DB string
  17. Charset string
  18. MaxIdle int
  19. MaxConn int
  20. LogMode bool
  21. }
  22. type RedisConfig struct {
  23. Addrs []string
  24. Password string
  25. DB int
  26. PoolSize int
  27. MinIdleConns int
  28. MaxRetries int
  29. Cluster bool
  30. }
  31. type ElasticConfig struct {
  32. Addrs []string
  33. Sniff bool
  34. }
  35. type ThirdPartNode struct {
  36. Host string
  37. AppKey string
  38. AppSecret string
  39. }
  40. type RongLianNode struct {
  41. City string
  42. RongLianSid string
  43. RongLianToken string
  44. RongLianServerIp string
  45. RongLianServerPort string
  46. RongLianSoftVersion string
  47. RongLianAppId string
  48. VcodeTemplateId int
  49. AlarmTemplateId int
  50. CompanyVerifyTemplateId int
  51. ProviderVerifyTemplateId int
  52. }
  53. type ThirdPartConfig struct {
  54. PartName ThirdPartNode
  55. RongLian RongLianNode
  56. MailHost string
  57. MailUser string
  58. MailPass string
  59. }
  60. type RPCNode struct {
  61. ServiceName string
  62. ServicePort int
  63. ServiceIp string
  64. MysqlDb string
  65. RedisDb int
  66. LogLevel string
  67. LogStacktrace bool
  68. }
  69. type KeepaliveConfig struct {
  70. ClientTime int
  71. ClientTimeout int
  72. ServerTime int
  73. ServerTimeout int
  74. ServerMiniTime int
  75. }
  76. type RPCConfig struct {
  77. Keepalive KeepaliveConfig
  78. SmartThirdparty RPCNode
  79. }
  80. type InfluxdbConfig struct {
  81. Addr string
  82. Username string
  83. Password string
  84. }
  85. type Configure struct {
  86. // 基础配置
  87. K8s bool
  88. RunMode string
  89. Log LogConfig
  90. EnterpriseUrl string
  91. SupplierUrl string
  92. // 按需配置
  93. Mysql MysqlConfig
  94. Redis RedisConfig
  95. Elastic ElasticConfig
  96. ThirdParty ThirdPartConfig
  97. Influxdb InfluxdbConfig
  98. // 所要启用的服务
  99. Rpc RPCConfig
  100. }