config.go 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. LocalUpload LocalUpload `mapstructure:"localUpload" json:"localUpload" yaml:"localUpload"`
  13. }
  14. type System struct {
  15. UseMultipoint bool `mapstructure:"use-multipoint" json:"useMultipoint" yaml:"use-multipoint"`
  16. Env string `mapstructure:"env" json:"env" yaml:"env"`
  17. Addr int `mapstructure:"addr" json:"addr" yaml:"addr"`
  18. DbType string `mapstructure:"db-type" json:"dbType" yaml:"db-type"`
  19. }
  20. type JWT struct {
  21. SigningKey string `mapstructure:"signing-key" json:"signingKey" yaml:"signing-key"`
  22. }
  23. type Casbin struct {
  24. ModelPath string `mapstructure:"model-path" json:"modelPath" yaml:"model-path"`
  25. }
  26. type Mysql struct {
  27. Username string `mapstructure:"username" json:"username" yaml:"username"`
  28. Password string `mapstructure:"password" json:"password" yaml:"password"`
  29. Path string `mapstructure:"path" json:"path" yaml:"path"`
  30. Dbname string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
  31. Config string `mapstructure:"config" json:"config" yaml:"config"`
  32. MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
  33. MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
  34. LogMode bool `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
  35. }
  36. type Redis struct {
  37. Addr string `mapstructure:"addr" json:"addr" yaml:"addr"`
  38. Password string `mapstructure:"password" json:"password" yaml:"password"`
  39. DB int `mapstructure:"db" json:"db" yaml:"db"`
  40. }
  41. type LocalUpload struct {
  42. Local bool `mapstructure:"local" json:"local" yaml:"local"`
  43. AvatarPath string `mapstructure:"avatar-path" json:"avatarPath" yaml:"avatar-path"`
  44. FilePath string `mapstructure:"file-path" json:"filePath" yaml:"file-path"`
  45. }
  46. type Qiniu struct {
  47. AccessKey string `mapstructure:"access-key" json:"accessKey" yaml:"access-key"`
  48. SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`
  49. Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
  50. ImgPath string `mapstructure:"img-path" json:"imgPath" yaml:"img-path"`
  51. }
  52. type Captcha struct {
  53. KeyLong int `mapstructure:"key-long" json:"keyLong" yaml:"key-long"`
  54. ImgWidth int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"`
  55. ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"`
  56. }
  57. type Log struct {
  58. Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
  59. LogFile bool `mapstructure:"log-file" json:"logFile" yaml:"log-file"`
  60. Stdout string `mapstructure:"stdout" json:"stdout" yaml:"stdout"`
  61. File string `mapstructure:"file" json:"file" yaml:"file"`
  62. }
  63. type Sqlite struct {
  64. Username string `mapstructure:"username" json:"username" yaml:"username"`
  65. Password string `mapstructure:"password" json:"password" yaml:"password"`
  66. Path string `mapstructure:"path" json:"path" yaml:"path"`
  67. Config string `mapstructure:"config" json:"config" yaml:"config"`
  68. LogMode bool `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
  69. }