From a0fce7bac806657d58f7b735f06cf94ceb1bbcbe Mon Sep 17 00:00:00 2001 From: Milhound Date: Fri, 21 Mar 2025 15:23:11 -0500 Subject: [PATCH] Move generics to their own file --- wow/gamedata/generics.go | 20 ++++++++++++++++++++ wow/gamedata/pvpseasonapi.go | 14 -------------- 2 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 wow/gamedata/generics.go diff --git a/wow/gamedata/generics.go b/wow/gamedata/generics.go new file mode 100644 index 0000000..409e04e --- /dev/null +++ b/wow/gamedata/generics.go @@ -0,0 +1,20 @@ +package gamedata + +const ( + UP string = "UP" + DOWN string = "DOWN" +) + +type href struct { + Href string `json:"href"` +} + +type idAndKey struct { + ID int `json:"id"` + Key href `json:"key"` +} + +type idAndType struct { + ID int `json:"id"` + Type string `json:"type"` +} diff --git a/wow/gamedata/pvpseasonapi.go b/wow/gamedata/pvpseasonapi.go index 6bffdab..79eda30 100644 --- a/wow/gamedata/pvpseasonapi.go +++ b/wow/gamedata/pvpseasonapi.go @@ -53,20 +53,6 @@ const ( ClassWarriorProtection string = "warrior-protection" ) -type href struct { - Href string `json:"href"` -} - -type idAndKey struct { - ID int `json:"id"` - Key href `json:"key"` -} - -type idAndType struct { - ID int `json:"id"` - Type string `json:"type"` -} - type PvpSeasonIndexAPI struct { Seasons []idAndKey `json:"seasons"` CurrentSeason idAndKey `json:"current_season"`