config.go 1.3 KB

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