75 lines
1.4 KiB
Go
75 lines
1.4 KiB
Go
/*
|
|
Copyright © 2024 filifa
|
|
|
|
This program is free software: you can redistribute it and/or modify it under
|
|
the terms of the GNU General Public License as published by the Free Software
|
|
Foundation, either version 3 of the License, or (at your option) any later
|
|
version.
|
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
package statsapi
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
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
|
|
}
|
|
|
|
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
|
|
}
|