You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
6.4 KiB

  1. package config
  2. type Server struct {
  3. Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
  4. Postgresql Postgresql `mapstructure:"postgresql" json:"postgresql" yaml:"postgresql"`
  5. Sqlite Sqlite `mapstructure:"sqlite" json:"sqlite" yaml:"sqlite"`
  6. Sqlserver Sqlserver `mapstructure:"sqlserver" json:"sqlserver" yaml:"sqlserver"`
  7. Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"`
  8. Casbin Casbin `mapstructure:"casbin" json:"casbin" yaml:"casbin"`
  9. Redis Redis `mapstructure:"redis" json:"redis" yaml:"redis"`
  10. System System `mapstructure:"system" json:"system" yaml:"system"`
  11. JWT JWT `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
  12. Captcha Captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"`
  13. Zap Zap `mapstructure:"zap" json:"zap" yaml:"zap"`
  14. LocalUpload LocalUpload `mapstructure:"localUpload" json:"localUpload" yaml:"localUpload"`
  15. Email Email `mapstructure:"email" json:"email" yaml:"email"`
  16. }
  17. type System struct {
  18. UseMultipoint bool `mapstructure:"use-multipoint" json:"useMultipoint" yaml:"use-multipoint"`
  19. Env string `mapstructure:"env" json:"env" yaml:"env"`
  20. Addr int `mapstructure:"addr" json:"addr" yaml:"addr"`
  21. DbType string `mapstructure:"db-type" json:"dbType" yaml:"db-type"`
  22. NeedInitData bool `mapstructure:"need-init-data" json:"needInitData" yaml:"need-init-data"`
  23. }
  24. type JWT struct {
  25. SigningKey string `mapstructure:"signing-key" json:"signingKey" yaml:"signing-key"`
  26. }
  27. type Casbin struct {
  28. ModelPath string `mapstructure:"model-path" json:"modelPath" yaml:"model-path"`
  29. }
  30. type Mysql struct {
  31. Username string `mapstructure:"username" json:"username" yaml:"username"`
  32. Password string `mapstructure:"password" json:"password" yaml:"password"`
  33. Path string `mapstructure:"path" json:"path" yaml:"path"`
  34. Dbname string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
  35. Config string `mapstructure:"config" json:"config" yaml:"config"`
  36. MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
  37. MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
  38. LogMode bool `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
  39. }
  40. type Postgresql struct {
  41. Username string `mapstructure:"username" json:"username" yaml:"username"`
  42. Password string `mapstructure:"password" json:"password" yaml:"password"`
  43. Dbname string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
  44. Port string `mapstructure:"port" json:"port" yaml:"port"`
  45. Config string `mapstructure:"config" json:"config" yaml:"config"`
  46. MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
  47. MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
  48. Logger bool `mapstructure:"logger" json:"logger" yaml:"logger"`
  49. PreferSimpleProtocol bool `mapstructure:"prefer-simple-protocol" json:"preferSimpleProtocol" yaml:"prefer-simple-protocol"`
  50. }
  51. type Sqlite struct {
  52. Path string `mapstructure:"path" json:"path" yaml:"path"`
  53. MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
  54. MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
  55. Logger bool `mapstructure:"logger" json:"logger" yaml:"logger"`
  56. }
  57. type Sqlserver 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. Dbname string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`
  62. MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
  63. MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
  64. Logger bool `mapstructure:"logger" json:"logger" yaml:"logger"`
  65. }
  66. type Redis struct {
  67. Addr string `mapstructure:"addr" json:"addr" yaml:"addr"`
  68. Password string `mapstructure:"password" json:"password" yaml:"password"`
  69. DB int `mapstructure:"db" json:"db" yaml:"db"`
  70. }
  71. type LocalUpload struct {
  72. Local bool `mapstructure:"local" json:"local" yaml:"local"`
  73. FilePath string `mapstructure:"file-path" json:"filePath" yaml:"file-path"`
  74. }
  75. type Qiniu struct {
  76. AccessKey string `mapstructure:"access-key" json:"accessKey" yaml:"access-key"`
  77. SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`
  78. Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`
  79. ImgPath string `mapstructure:"img-path" json:"imgPath" yaml:"img-path"`
  80. }
  81. type Captcha struct {
  82. KeyLong int `mapstructure:"key-long" json:"keyLong" yaml:"key-long"`
  83. ImgWidth int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"`
  84. ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"`
  85. }
  86. type Zap struct {
  87. Level string `mapstructure:"level" json:"level" yaml:"level"`
  88. Format string `mapstructure:"format" json:"format" yaml:"format"`
  89. Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
  90. Director string `mapstructure:"director" json:"director" yaml:"director"`
  91. LinkName string `mapstructure:"link_name" json:"linkName" yaml:"link_name"`
  92. ShowLine bool `mapstructure:"show_line" json:"showLine" yaml:"showLine"`
  93. EncodeLevel string `mapstructure:"encode_level" json:"encodeLevel" yaml:"encode_level"`
  94. StacktraceKey string `mapstructure:"stacktrace_key" json:"stacktraceKey" yaml:"stacktrace_key"`
  95. LogInConsole bool `mapstructure:"log_in_console" json:"logInConsole" yaml:"log_in_console"`
  96. }
  97. type Email struct {
  98. EmailFrom string `mapstructure:"email_from" json:"emailFrom" yaml:"email_from"`
  99. EmailNickName string `mapstructure:"email_nick_name" json:"emailNickName" yaml:"email_nick_name"`
  100. EmailSecret string `mapstructure:"email_secret" json:"emailSecret" yaml:"email_secret"`
  101. EmailTo string `mapstructure:"email_to" json:"emailTo" yaml:"email_to"`
  102. EmailHost string `mapstructure:"email_host" json:"emailHost" yaml:"email_host"`
  103. EmailPort int `mapstructure:"email_port" json:"emailPort" yaml:"email_port"`
  104. EmailIsSSL bool `mapstructure:"email_isSSL" json:"emailIsSSL" yaml:"email_isSSL"`
  105. }