flesh out game struct

This commit is contained in:
filifa
2024-07-03 01:01:02 -05:00
parent ff5f7f3a6d
commit 0a49223173
3 changed files with 144 additions and 57 deletions

View File

@@ -9,7 +9,9 @@ type FeedParams struct {
}
type FeedResponse struct {
GamePk string
MetaData metadata
GameData gamedata
LiveData livedata
}
@@ -17,8 +19,23 @@ type metadata struct {
TimeStamp string
}
type gamedata struct {
Teams teams
}
type teams struct {
Away team
Home team
}
type team struct {
LocationName string
TeamName string
}
type livedata struct {
Plays plays
Plays plays
Linescore linescore
}
type plays struct {
@@ -49,6 +66,22 @@ type about struct {
CaptivatingIndex json.Number
}
type linescore struct {
Teams teamLines
}
type teamLines struct {
Home teamline
Away teamline
}
type teamline struct {
Runs json.Number
Hits json.Number
Errors json.Number
LeftOnBase json.Number
}
func (p *Play) Patch(patch Patch) {
instructions := patch.Diff
stem := "/liveData/plays/currentPlay"