mlblive/internal/statsapi/feed.go

60 lines
749 B
Go
Raw Normal View History

2024-07-02 04:16:44 +00:00
package statsapi
import (
"encoding/json"
)
2024-07-13 21:37:04 +00:00
type Feed struct {
MetaData metadata
LiveData livedata
}
type metadata struct {
TimeStamp string
}
type livedata struct {
Plays plays
Linescore linescore
}
type linescore struct {
Teams teams
}
type teams struct {
Home team
Away team
}
type team struct {
Runs json.Number
}
type plays struct {
AllPlays []Play
CurrentPlay Play
}
2024-07-02 04:16:44 +00:00
type Play struct {
Result result
About about
AtBatIndex int
}
type result struct {
Event string
Description string
RBI int
AwayScore int
HomeScore int
}
type about struct {
AtBatIndex json.Number
IsTopInning bool
Inning json.Number
IsScoringPlay bool
CaptivatingIndex json.Number
}