config.go 1.4 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. Mysql string
  10. Redis *RedisConfig
  11. Mongodb *mgoConf
  12. SurvivalTime int
  13. SaveConcurrency int // 消息保存并发数
  14. WxTmplConfig WxTmplMsg `json:"WxTmplConfig"`
  15. }
  16. type RedisConfig struct {
  17. Host string
  18. Addr string
  19. Modules string
  20. }
  21. type mysqlConfig struct {
  22. DbName string
  23. Address string
  24. UserName string
  25. PassWord string
  26. MaxOpenConns int
  27. MaxIdleConns int
  28. }
  29. type mgoConf struct {
  30. Address string
  31. Size int
  32. DbName string
  33. ReplSet string
  34. UserName string
  35. Password string
  36. Collection string
  37. Collection_back string
  38. }
  39. var ConfigJson Config
  40. type WxTmplMsg struct {
  41. RpcAddr string `json:"rpcAddr"`
  42. TmplSetting struct {
  43. JySchool string `json:"jySchool"`
  44. System string `json:"system"`
  45. CloseNotice string `json:"closeNotice"`
  46. } `json:"tmplSetting"`
  47. Limit struct {
  48. Total int `json:"total"`
  49. PrivateMessage struct {
  50. OneDayLimit int `json:"oneDayLimit"`
  51. DuringMine int `json:"duringMine"`
  52. } `json:"privateMessage"`
  53. Alert struct {
  54. Nums []int `json:"nums"`
  55. Mail []string `json:"mail"`
  56. } `json:"alert"`
  57. } `json:"limit"`
  58. }