config.go 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. package config
  2. type Server struct {
  3. Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
  4. Sqlite Sqlite `mapstructure:"sqlite" json:"sqlite" yaml:"sqlite"`
  5. Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"`
  6. Casbin Casbin `mapstructure:"casbin" json:"casbin" yaml:"casbin"`
  7. Redis Redis `mapstructure:"redis" json:"redis" yaml:"redis"`
  8. System System `mapstructure:"system" json:"system" yaml:"system"`
  9. JWT JWT `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
  10. Captcha Captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"`
  11. Log Log `mapstructure:"log" json:"log" yaml:"log"`
  12. Zap Zap `mapstructure:"zap" json:"zap" yaml:"zap"`
  13. LocalUpload LocalUpload `mapstructure:"localUpload" json:"localUpload" yaml:"localUpload"`
  14. }
  15. type System struct {
  16. UseMultipoint bool `mapstructure:"use-multipoint" json:"useMultipoint" yaml:"use-multipoint"`
  17. Env string `mapstructure:"env" json:"env" yaml:"env"`
  18. Addr int `mapstructure:"addr" json:"addr" yaml:"addr"`
  19. DbType string `mapstructure:"db-type" json:"dbType" yaml:"db-type"`
  20. }
  21. type JWT struct {
  22. SigningKey string `mapstructure:"signing-key" json:"signingKey" yaml:"signing-key"`
  23. }
  24. type Casbin struct {
  25. ModelPath string `mapstructure:"model-path" json:"modelPath" yaml:"model-path"`
  26. }
  27. type Mysql struct {
  28. Username string `mapstructure:"username" json:"username" yaml:"username"`
  29. Password string `mapstructure:"password" json:"password" yaml:"password"`
  30. Path string `mapstructure:"path" json:"path" yaml:"path"`
  31. Dbname string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
  32. Config string `mapstructure:"config" json:"config" yaml:"config"`
  33. MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
  34. MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
  35. LogMode bool `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
  36. }
  37. type Redis struct {
  38. Addr string `mapstructure:"addr" json:"addr" yaml:"addr"`
  39. Password string `mapstructure:"password" json:"password" yaml:"password"`
  40. DB int `mapstructure:"db" json:"db" yaml:"db"`
  41. }
  42. type LocalUpload struct {
  43. Local bool `mapstructure:"local" json:"local" yaml:"local"`
  44. AvatarPath string `mapstructure:"avatar-path" json:"avatarPath" yaml:"avatar-path"`
  45. FilePath string `mapstructure:"file-path" json:"filePath" yaml:"file-path"`
  46. }
  47. type Qiniu struct {
  48. AccessKey string `mapstructure:"access-key" json:"accessKey" yaml:"access-key"`
  49. SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`
  50. Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
  51. ImgPath string `mapstructure:"img-path" json:"imgPath" yaml:"img-path"`
  52. }
  53. type Captcha struct {
  54. KeyLong int `mapstructure:"key-long" json:"keyLong" yaml:"key-long"`
  55. ImgWidth int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"`
  56. ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"`
  57. }
  58. type Log struct {
  59. Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
  60. LogFile bool `mapstructure:"log-file" json:"logFile" yaml:"log-file"`
  61. Stdout string `mapstructure:"stdout" json:"stdout" yaml:"stdout"`
  62. File string `mapstructure:"file" json:"file" yaml:"file"`
  63. }
  64. type Sqlite struct {
  65. Username string `mapstructure:"username" json:"username" yaml:"username"`
  66. Password string `mapstructure:"password" json:"password" yaml:"password"`
  67. Path string `mapstructure:"path" json:"path" yaml:"path"`
  68. Config string `mapstructure:"config" json:"config" yaml:"config"`
  69. LogMode bool `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
  70. }
  71. type Zap struct {
  72. Level string `json:"level"`
  73. File string `json:"file"`
  74. MaxSize int `json:"maxsize"`
  75. MaxAge int `json:"max_age"`
  76. MaxBackups int `json:"max_backups"`
  77. }