config.go 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 `mapstructure:"level" json:"level" yaml:"level"`
  73. Format string `mapstructure:"format" json:"format" yaml:"format"`
  74. Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
  75. Director string `mapstructure:"director" json:"director" yaml:"director"`
  76. LinkName string `mapstructure:"link_name" json:"linkName" yaml:"link_name"`
  77. ShowLine bool `mapstructure:"show_line" json:"show_line" yaml:"show_line"`
  78. LogInConsole bool `mapstructure:"log_in_console" json:"logInConsole" yaml:"log_in_console"`
  79. }