config.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. Log2File Log2File `mapstructure:"log2file"`
  21. }
  22. // Server 服务启动端口配置
  23. type Server struct {
  24. Port string `mapstructure:"port"`
  25. }
  26. // SQLite Mysql 数据源配置
  27. type SQLite struct {
  28. Url string `mapstructure:"url"`
  29. }
  30. // Jwt 用户认证配置
  31. type Jwt struct {
  32. SigningKey string `mapstructure:"signingKey"`
  33. }
  34. // Upload 文件上传相关路径配置
  35. type Upload struct {
  36. SavePath string `mapstructer:"savePath"`
  37. AccessUrl string `mapstructure:"accessUrl"`
  38. }
  39. type Websocket struct {
  40. WSUrl string `mapstructure:"ws-url"`
  41. }
  42. type Log2File struct {
  43. FilePath string `mapstructure:"filePath"`
  44. FileName string `mapstructure:"FileName"`
  45. FileSuffix string `mapstructure:"FileSuffix"`
  46. }