-
Notifications
You must be signed in to change notification settings - Fork 6
/
api_types.go
188 lines (162 loc) · 4.02 KB
/
api_types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
package footballdata
import "time"
type FixtureStatus string
const (
FixtureStatus_Scheduled FixtureStatus = "SCHEDULED"
FixtureStatus_Timed FixtureStatus = "TIMED"
FixtureStatus_Postponed FixtureStatus = "POSTPONED"
FixtureStatus_InPlay FixtureStatus = "IN_PLAY"
FixtureStatus_Canceled FixtureStatus = "CANCELED"
FixtureStatus_Finished FixtureStatus = "FINISHED"
)
// Describes the venue.
type Venue string
const (
// The home venue.
Venue_Home Venue = "home"
// The away venue.
Venue_Away Venue = "away"
)
// DEPRECATED.
//
// Contains the list of soccer seasons returned by the API.
type SoccerSeasonList []SoccerSeason
// DEPRECATED.
//
// Contains information about a soccer season.
type SoccerSeason struct {
Id uint64
Caption string
League string
Year string
CurrentMatchday uint16
NumberOfMatchdays uint16
NumberOfTeams uint16
NumberOfGames uint16
LastUpdated time.Time
}
// Contains the list of competitions returned by the API.
type CompetitionList []Competition
// Contains information about a competition.
type Competition struct {
Id uint64
Caption string
League string
Year string
CurrentMatchday uint16
NumberOfMatchdays uint16
NumberOfTeams uint16
NumberOfGames uint16
LastUpdated time.Time
}
// Contains the fixture and the head to head information delivered by the API
// for a wanted fixture.
type FixtureResponse struct {
Fixture Fixture
Head2Head Head2Head
}
// Contains head to head information.
type Head2Head struct {
Count uint64
TimeFrameStart time.Time
TimeFrameEnd time.Time
HomeTeamWins uint64
AwayTeamWins uint64
Draws uint64
LastHomeWinHomeTeam *Fixture
LastWinHomeTeam *Fixture
LastAwayWinAwayTeam *Fixture
Fixtures []Fixture
}
// Contains information about a fixture.
type Fixture struct {
Date time.Time
Status FixtureStatus
Matchday uint16
HomeTeamName string
AwayTeamName string
Result FixtureResult
//HomeTeamId uint64
//AwayTeamId uint64
}
// Contains a list of fixtures.
type FixtureList struct {
Count uint64
Fixtures []Fixture
}
// Contains information about a list of fixtures as returned by the API.
type FixturesResponse struct {
FixtureList
TimeFrameStart time.Time
TimeFrameEnd time.Time
}
// Contains information about a fixture's results.
type FixtureResult struct {
FixtureScore
HalfTime *FixtureScore
ExtraTime *FixtureScore
PenaltyShootout *FixtureScore
}
type FixtureScore struct {
GoalsHomeTeam uint16
GoalsAwayTeam uint16
}
// Contains a list of teams.
type TeamList struct {
Count uint64
Teams []Team
}
// Contains information about a team.
type Team struct {
Id uint64
Name string
ShortName string
SquadMarketValue string
CrestUrl string
}
// Contains a list of players.
type PlayerList struct {
Count uint64
Players []Player
}
// Contains information about a player.
type Player struct {
Id uint64
Name string
Position string
JerseyNumber uint8
DateOfBirth time.Time
Nationality string
ContractUntil time.Time
MarketValue string
}
// Contains the league table for a season.
type LeagueTable struct {
LeagueCaption string
Matchday uint16
Standing []TeamLeagueStatistics
}
// Contains statistical information about a team's performance in a league.
// TODO - Introduce minified variant of this struct.
type TeamLeagueStatistics struct {
TeamName string
CrestURI string
Draws uint16
GoalDifference int16
Goals uint16
GoalsAgainst uint16
Losses uint16
PlayedGames uint8
Points uint16
Position uint8
Wins uint16
Home ShortTeamLeagueStatistics
Away ShortTeamLeagueStatistics
}
type ShortTeamLeagueStatistics struct {
Draws uint16
Goals uint16
GoalsAgainst uint16
Losses uint16
Wins uint16
}