config.go 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. Email Email `mapstructure:"email" json:"email" yaml:"email"`
  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. NeedInitData bool `mapstructure:"need-init-data" json:"needInitData" yaml:"need-init-data"`
  21. }
  22. type JWT struct {
  23. SigningKey string `mapstructure:"signing-key" json:"signingKey" yaml:"signing-key"`
  24. }
  25. type Casbin struct {
  26. ModelPath string `mapstructure:"model-path" json:"modelPath" yaml:"model-path"`
  27. }
  28. type Mysql struct {
  29. Username string `mapstructure:"username" json:"username" yaml:"username"`
  30. Password string `mapstructure:"password" json:"password" yaml:"password"`
  31. Path string `mapstructure:"path" json:"path" yaml:"path"`
  32. Dbname string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
  33. Config string `mapstructure:"config" json:"config" yaml:"config"`
  34. MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
  35. MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
  36. LogMode bool `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
  37. }
  38. type Redis struct {
  39. Addr string `mapstructure:"addr" json:"addr" yaml:"addr"`
  40. Password string `mapstructure:"password" json:"password" yaml:"password"`
  41. DB int `mapstructure:"db" json:"db" yaml:"db"`
  42. }
  43. type LocalUpload struct {
  44. Local bool `mapstructure:"local" json:"local" yaml:"local"`
  45. AvatarPath string `mapstructure:"avatar-path" json:"avatarPath" yaml:"avatar-path"`
  46. FilePath string `mapstructure:"file-path" json:"filePath" yaml:"file-path"`
  47. }
  48. type Qiniu struct {
  49. AccessKey string `mapstructure:"access-key" json:"accessKey" yaml:"access-key"`
  50. SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`
  51. Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
  52. ImgPath string `mapstructure:"img-path" json:"imgPath" yaml:"img-path"`
  53. }
  54. type Captcha struct {
  55. KeyLong int `mapstructure:"key-long" json:"keyLong" yaml:"key-long"`
  56. ImgWidth int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"`
  57. ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"`
  58. }
  59. type Sqlite struct {
  60. Username string `mapstructure:"username" json:"username" yaml:"username"`
  61. Password string `mapstructure:"password" json:"password" yaml:"password"`
  62. Path string `mapstructure:"path" json:"path" yaml:"path"`
  63. Config string `mapstructure:"config" json:"config" yaml:"config"`
  64. LogMode bool `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
  65. }
  66. type Zap struct {
  67. Level string `mapstructure:"level" json:"level" yaml:"level"`
  68. Format string `mapstructure:"format" json:"format" yaml:"format"`
  69. Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
  70. Director string `mapstructure:"director" json:"director" yaml:"director"`
  71. LinkName string `mapstructure:"link_name" json:"linkName" yaml:"link_name"`
  72. ShowLine bool `mapstructure:"show_line" json:"showLine" yaml:"showLine"`
  73. EncodeLevel string `mapstructure:"encode_level" json:"encodeLevel" yaml:"encode_level"`
  74. StacktraceKey string `mapstructure:"stacktrace_key" json:"stacktraceKey" yaml:"stacktrace_key"`
  75. LogInConsole bool `mapstructure:"log_in_console" json:"logInConsole" yaml:"log_in_console"`
  76. }
  77. type Email struct {
  78. EmailFrom string `mapstructure:"email_from" json:"emailFrom" yaml:"email_from"`
  79. EmailNickName string `mapstructure:"email_nick_name" json:"emailNickName" yaml:"email_nick_name"`
  80. EmailSecret string `mapstructure:"email_secret" json:"emailSecret" yaml:"email_secret"`
  81. EmailTo string `mapstructure:"email_to" json:"emailTo" yaml:"email_to"`
  82. EmailHost string `mapstructure:"email_host" json:"emailHost" yaml:"email_host"`
  83. EmailPort int `mapstructure:"email_port" json:"emailPort" yaml:"email_port"`
  84. EmailIsSSL bool `mapstructure:"email_isSSL" json:"emailIsSSL" yaml:"email_isSSL"`
  85. }