config.go 1.6 KB

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