config.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package config
  2. type Gateway struct {
  3. BaseUrl string `mapstructure:"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. ConnectedUrl string `mapstructure:"connectedList"`
  13. }
  14. type Param struct {
  15. FirstOpen string `mapstructure:"firstOpen"`
  16. }
  17. type Config struct {
  18. Server Server `mapstructure:"server"`
  19. SQLite SQLite `mapstructure:"sqlite"`
  20. Jwt Jwt `mapstructure:"jwt"`
  21. Upload Upload `mapstructure:"upload"`
  22. Websocket Websocket `mapstructure:"websocket"`
  23. Gateway Gateway `mapstructure:"gateway"`
  24. Log2File Log2File `mapstructure:"log2file"`
  25. Param Param `mapstructure:"Param"`
  26. }
  27. // Server 服务启动端口配置
  28. type Server struct {
  29. Port string `mapstructure:"port"`
  30. }
  31. // SQLite Mysql 数据源配置
  32. type SQLite struct {
  33. Url string `mapstructure:"url"`
  34. }
  35. // Jwt 用户认证配置
  36. type Jwt struct {
  37. SigningKey string `mapstructure:"signingKey"`
  38. }
  39. // Upload 文件上传相关路径配置
  40. type Upload struct {
  41. SavePath string `mapstructure:"savePath"`
  42. AccessUrl string `mapstructure:"accessUrl"`
  43. }
  44. type Websocket struct {
  45. WSUrl string `mapstructure:"ws-url"`
  46. }
  47. type Log2File struct {
  48. FilePath string `mapstructure:"filePath"`
  49. FileName string `mapstructure:"FileName"`
  50. FileSuffix string `mapstructure:"FileSuffix"`
  51. }