You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.1 KiB

  1. package config
  2. type Server struct {
  3. Mysql Mysql `mapstructure:"mysql" json:"mysql"`
  4. Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu"`
  5. Casbin Casbin `mapstructure:"casbin" json:"casbin"`
  6. Redis Redis `mapstructure:"redis" json:"redis"`
  7. System System `mapstructure:"system" json:"system"`
  8. JWT JWT `mapstructure:"jwt" json:"jwt"`
  9. Captcha Captcha `mapstructure:"captcha" json:"captcha"`
  10. Log Log `mapstructure:"log" json:"log"`
  11. }
  12. type System struct {
  13. UseMultipoint bool `mapstructure:"use-multipoint" json:"useMultipoint"`
  14. Env string `mapstructure:"env" json:"env"`
  15. Addr int `mapstructure:"addr" json:"addr"`
  16. }
  17. type JWT struct {
  18. SigningKey string `mapstructure:"signing-key" json:"signingKey"`
  19. }
  20. type Casbin struct {
  21. ModelPath string `mapstructure:"model-path" json:"modelPath"`
  22. }
  23. type Mysql struct {
  24. Username string `mapstructure:"username" json:"username"`
  25. Password string `mapstructure:"password" json:"password"`
  26. Path string `mapstructure:"path" json:"path"`
  27. Dbname string `mapstructure:"db-name" json:"dbname"`
  28. Config string `mapstructure:"config" json:"config"`
  29. MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns"`
  30. MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns"`
  31. LogMode bool `mapstructure:"log-mode" json:"logMode"`
  32. }
  33. type Redis struct {
  34. Addr string `mapstructure:"addr" json:"addr"`
  35. Password string `mapstructure:"password" json:"password"`
  36. DB int `mapstructure:"db" json:"db"`
  37. }
  38. type Qiniu struct {
  39. AccessKey string `mapstructure:"access-key" json:"accessKey"`
  40. SecretKey string `mapstructure:"secret-key" json:"secretKey"`
  41. }
  42. type Captcha struct {
  43. KeyLong int `mapstructure:"key-long" json:"keyLong"`
  44. ImgWidth int `mapstructure:"img-width" json:"imgWidth"`
  45. ImgHeight int `mapstructure:"img-height" json:"imgHeight"`
  46. }
  47. type Log struct {
  48. Prefix string `mapstructure:"prefix" json:"prefix"`
  49. LogFile bool `mapstructure:"log-file" json:"logFile"`
  50. Stdout string `mapstructure:"stdout" json:"stdout"`
  51. File string `mapstructure:"file" json:"file"`
  52. }