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.

70 lines
2.5 KiB

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