config.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. OpenChannel string `mapstructure:"openChannel"`
  11. }
  12. type Config struct {
  13. Server Server `mapstructure:"server"`
  14. SQLite SQLite `mapstructure:"sqlite"`
  15. Jwt Jwt `mapstructure:"jwt"`
  16. Upload Upload `mapstructure:"upload"`
  17. Websocket Websocket `mapstructure:"websocket"`
  18. Gateway Gateway `mapstructure:"gateway"`
  19. }
  20. // Server 服务启动端口配置
  21. type Server struct {
  22. Port string `mapstructure:"port"`
  23. }
  24. // Mysql 数据源配置
  25. type SQLite struct {
  26. Url string `mapstructure:"url"`
  27. }
  28. // Jwt 用户认证配置
  29. type Jwt struct {
  30. SigningKey string `mapstructure:"signingKey"`
  31. }
  32. // 文件上传相关路径配置
  33. type Upload struct {
  34. SavePath string `mapstructer:"savePath"`
  35. AccessUrl string `mapstructure:"accessUrl"`
  36. }
  37. type Websocket struct {
  38. WSUrl string `mapstructure:"ws-url"`
  39. }