config.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package config
  2. type Gateway struct {
  3. BaseUrl string `mpstructure:"baseUrl"`
  4. ScanUrl string `mapstructure:"scanUrl"`
  5. ScanSecond int64 `mapstructure:"scanSecond"`
  6. ConnUrl string `mapstructure:"connUrl"`
  7. NotifyUrl string `mapstructure:"notifyUrl"`
  8. WriteDataUrl string `mapstructure:"writeDataUrl"`
  9. StartCollectUrl string `mapstructure:"startCollectUrl"`
  10. }
  11. type Config struct {
  12. Server Server `mapstructure:"server"`
  13. SQLite SQLite `mapstructure:"sqlite"`
  14. Jwt Jwt `mapstructure:"jwt"`
  15. Upload Upload `mapstructure:"upload"`
  16. Websocket Websocket `mapstructure:"websocket"`
  17. Gateway Gateway `mapstructure:"gateway"`
  18. }
  19. // Server 服务启动端口配置
  20. type Server struct {
  21. Port string `mapstructure:"port"`
  22. }
  23. // Mysql 数据源配置
  24. type SQLite struct {
  25. Url string `mapstructure:"url"`
  26. }
  27. // Jwt 用户认证配置
  28. type Jwt struct {
  29. SigningKey string `mapstructure:"signingKey"`
  30. }
  31. // 文件上传相关路径配置
  32. type Upload struct {
  33. SavePath string `mapstructer:"savePath"`
  34. AccessUrl string `mapstructure:"accessUrl"`
  35. }
  36. type Websocket struct {
  37. WSUrl string `mapstructure:"ws-url"`
  38. }