config.go 745 B

12345678910111213141516171819202122232425262728293031323334
  1. package config
  2. type Config struct {
  3. Server Server `mapstructure:"server"`
  4. SQLite SQLite `mapstructure:"sqlite"`
  5. Jwt Jwt `mapstructure:"jwt"`
  6. Upload Upload `mapstructure:"upload"`
  7. Websocket Websocket `mapstructure:"websocket"`
  8. }
  9. // Server 服务启动端口配置
  10. type Server struct {
  11. Port string `mapstructure:"port"`
  12. }
  13. // Mysql 数据源配置
  14. type SQLite struct {
  15. Url string `mapstructure:"url"`
  16. }
  17. // Jwt 用户认证配置
  18. type Jwt struct {
  19. SigningKey string `mapstructure:"signingKey"`
  20. }
  21. // 文件上传相关路径配置
  22. type Upload struct {
  23. SavePath string `mapstructer:"savePath"`
  24. AccessUrl string `mapstructure:"accessUrl"`
  25. }
  26. type Websocket struct {
  27. WSUrl string `mapstructure:"ws-url"`
  28. }