structs.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package main
  2. // Config This contains all the application specific config
  3. type Config struct {
  4. ListenAddress string
  5. EDUser string
  6. EDPass string
  7. RedisIP string
  8. RedisPort string
  9. RedisPassword string
  10. RedisDB string
  11. GeoIP2File string
  12. PromPNGURL string
  13. BlackList string
  14. }
  15. // DCSServers is struct to capture the JSON data returning from DCS.com
  16. type DCSServers struct {
  17. ServersMaxCount int `json:"SERVERS_MAX_COUNT"`
  18. ServersMaxDate string `json:"SERVERS_MAX_DATE"`
  19. PlayersCount int `json:"PLAYERS_COUNT"`
  20. MyServers []interface{} `json:"MY_SERVERS"`
  21. Servers []struct {
  22. Name string `json:"NAME"`
  23. IPAddress string `json:"IP_ADDRESS"`
  24. Port string `json:"PORT"`
  25. MissionName string `json:"MISSION_NAME"`
  26. MissionTime string `json:"MISSION_TIME"`
  27. Players string `json:"PLAYERS"`
  28. PlayersMax string `json:"PLAYERS_MAX"`
  29. Password string `json:"PASSWORD"`
  30. Description string `json:"DESCRIPTION"`
  31. MissionTimeFormatted string `json:"MISSION_TIME_FORMATTED"`
  32. } `json:"SERVERS"`
  33. }
  34. // ServerMeta Metadate of servers stored in Redis
  35. type ServerMeta struct {
  36. Name string
  37. IPAddress string
  38. Port string
  39. MissionName string
  40. MissionTime int // Convert
  41. Players int // Convert
  42. PlayersMax int // Convert
  43. Password bool // "Yes"/"No"
  44. Description string // "No"
  45. MissionTimeFormatted string
  46. CountryName string // These are new
  47. ISO string
  48. LastUpdate int
  49. }
  50. // GlobalMaxims Maxims recorded for storage in Redis
  51. type GlobalMaxims struct {
  52. MaxServers int
  53. MaxServersTime int
  54. MaxPlayers int
  55. MaxPlayersTime int
  56. }