config.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package config
  2. import (
  3. "github.com/zeromicro/go-zero/zrpc"
  4. )
  5. type Config struct {
  6. zrpc.RpcServerConf
  7. DataSource *mysqlConfig // 手动代码
  8. BaseSource *mysqlConfig // 手动代码
  9. WebRpcPort int
  10. Mysql string
  11. RedisAddr string `json:"RedisAddr"`
  12. Mongodb *mgoConf
  13. SurvivalTime int
  14. SaveConcurrency int // 消息保存并发数
  15. WxWebdomain string `json:"WxWebdomain"`
  16. WxTmplConfig WxTmplMsg `json:"WxTmplConfig"`
  17. PushGrpcServer string `json:"PushGrpcServer"`
  18. Mail []struct {
  19. Addr string `json:"addr"`
  20. Port int `json:"port"`
  21. Pwd string `json:"pwd"`
  22. User string `json:"user"`
  23. } `json:"mail"`
  24. TidbEng string `json:"Tidb"`
  25. ClassSearchList []int64 `json:"ClassSearchList"` // 需要按照messageclass 查询的groupId
  26. }
  27. type mysqlConfig struct {
  28. DbName string
  29. Address string
  30. UserName string
  31. PassWord string
  32. MaxOpenConns int
  33. MaxIdleConns int
  34. }
  35. type mgoConf struct {
  36. Address string
  37. Size int
  38. DbName string
  39. ReplSet string
  40. UserName string
  41. Password string
  42. Collection string
  43. Collection_back string
  44. }
  45. var ConfigJson Config
  46. type WxTmplMsg struct {
  47. RpcAddr string `json:"rpcAddr"`
  48. CloseNotice string `json:"closeNotice"`
  49. Limit struct {
  50. Total int64 `json:"total"`
  51. OneDayLimit int64 `json:"oneDayLimit"`
  52. DuringMine int `json:"duringMine"`
  53. Alert struct {
  54. Nums []int64 `json:"nums"`
  55. ToMail []string `json:"toMail"`
  56. CcMail []string `json:"ccMail"`
  57. } `json:"alert"`
  58. } `json:"limit"`
  59. }