config.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package config
  2. // Yaml2Go
  3. type Server struct {
  4. Redis Redis `json:"redis" yaml:"redis"`
  5. Log Log `json:"log" yaml:"log"`
  6. System System `json:"system" yaml:"system"`
  7. Jwt Jwt `json:"jwt" yaml:"jwt"`
  8. Mysql Mysql `json:"mysql" yaml:"mysql"`
  9. Cq119 CQ119 `json:"cq119" yaml:"cq119"`
  10. }
  11. // Cache
  12. type Cache struct {
  13. RefrushTokenExpire int `json:"refrush_token_expire" yaml:"refrushTokenExpire"`
  14. TokenExpire int `json:"token_expire" yaml:"tokenExpire"`
  15. }
  16. // System
  17. type System struct {
  18. Port int `json:"port" yaml:"port"`
  19. }
  20. // Redis
  21. type Redis struct {
  22. Host string `json:"host" yaml:"host"`
  23. Password string `json:"password" yaml:"password"`
  24. Cache Cache `json:"cache" yaml:"cache"`
  25. Db int `json:"db" yaml:"db"`
  26. }
  27. // Log
  28. type Log struct {
  29. Path string `json:"path" yaml:"path"`
  30. Name string `json:"name" yaml:"name"`
  31. Level int `json:"level" yaml:"level"`
  32. CallLogUrl string `json:"callLogUrl" yaml:"callLogUrl"`
  33. }
  34. // Jwt
  35. type Jwt struct {
  36. Signkey string `json:"signkey" yaml:"signkey"`
  37. }
  38. // Conn
  39. type Conn struct {
  40. MaxIdleConn int `json:"max_idle_conn" yaml:"maxIdleConn"`
  41. MaxOpenConn int `json:"max_open_conn" yaml:"maxOpenConn"`
  42. }
  43. // Mysql
  44. type Mysql struct {
  45. Charset string `json:"charset" yaml:"charset"`
  46. Loc string `json:"loc" yaml:"loc"`
  47. Conn Conn `json:"conn" yaml:"conn"`
  48. Host string `json:"host" yaml:"host"`
  49. Database string `json:"database" yaml:"database"`
  50. Username string `json:"username" yaml:"username"`
  51. Password string `json:"password" yaml:"password"`
  52. }
  53. type CQ119 struct{
  54. Username string `json:"username" yaml:"username"`
  55. Password string `json:"password" yaml:"password"`
  56. LoginUrl string `json:"loginUrl" yaml:"loginUrl"`
  57. }