config.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 ThirdPartConfig struct {
  41. PartName ThirdPartNode
  42. }
  43. type RPCNode struct {
  44. ServiceName string
  45. ServicePort int
  46. ServiceIp string
  47. MysqlDb string
  48. RedisDb int
  49. LogLevel string
  50. LogStacktrace bool
  51. }
  52. type KeepaliveConfig struct {
  53. ClientTime int
  54. ClientTimeout int
  55. ServerTime int
  56. ServerTimeout int
  57. ServerMiniTime int
  58. }
  59. type RPCConfig struct {
  60. Keepalive KeepaliveConfig
  61. SmartSupplierManagement RPCNode
  62. SmartThirdparty RPCNode
  63. }
  64. type InfluxdbConfig struct {
  65. Addr string
  66. Username string
  67. Password string
  68. }
  69. type Configure struct {
  70. // 基础配置
  71. VedioArea string
  72. K8s bool
  73. RunMode string
  74. Log LogConfig
  75. // 按需配置
  76. Mysql MysqlConfig
  77. Redis RedisConfig
  78. Elastic ElasticConfig
  79. ThirdPart ThirdPartConfig
  80. Influxdb InfluxdbConfig
  81. // 所要启用的服务
  82. Rpc RPCConfig
  83. }