config.go 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. Zap Zap `mapstructure:"zap" json:"zap" yaml:"zap"`
  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 Sqlite struct {
  58. Username string `mapstructure:"username" json:"username" yaml:"username"`
  59. Password string `mapstructure:"password" json:"password" yaml:"password"`
  60. Path string `mapstructure:"path" json:"path" yaml:"path"`
  61. Config string `mapstructure:"config" json:"config" yaml:"config"`
  62. LogMode bool `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
  63. }
  64. type Zap struct {
  65. Level string `mapstructure:"level" json:"level" yaml:"level"`
  66. Format string `mapstructure:"format" json:"format" yaml:"format"`
  67. Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
  68. Director string `mapstructure:"director" json:"director" yaml:"director"`
  69. LinkName string `mapstructure:"link_name" json:"linkName" yaml:"link_name"`
  70. ShowLine bool `mapstructure:"show_line" json:"showLine" yaml:"showLine"`
  71. EncodeLevel string `mapstructure:"encode_level" json:"encodeLevel" yaml:"encode_level"`
  72. StacktraceKey string `mapstructure:"stacktrace_key" json:"stacktraceKey" yaml:"stacktrace_key"`
  73. LogInConsole bool `mapstructure:"log_in_console" json:"logInConsole" yaml:"log_in_console"`
  74. }