Documentation ¶
Index ¶
- Constants
- Variables
- func ToURLQueryString(data any) string
- type Client
- type Corpus
- func (c *Corpus) Country(ctx context.Context, cp CountryParams) (CountryResponse, error)
- func (c *Corpus) Event(ctx context.Context, params EventParams) (EventResponse, error)
- func (c *Corpus) FixtureInfo(ctx context.Context, params FixtureInfoParams) (FixtureInfoResponse, error)
- func (c *Corpus) FixtureStats(ctx context.Context, params FixtureStatsParams) (FixtureStatsResponse, error)
- func (c *Corpus) Head2Head(ctx context.Context, params Head2HeadParams) (Head2HeadResponse, error)
- func (c *Corpus) LeagueInfo(ctx context.Context, params LeagueInfoParams) (LeagueInfoResponse, error)
- func (c *Corpus) Lineup(ctx context.Context, params LineupParams) (LineupResponse, error)
- func (c *Corpus) PlayerStats(ctx context.Context, params PlayerStatsParams) (PlayerStatsResponse, error)
- func (c *Corpus) Round(ctx context.Context, params RoundParams) (RoundResponse, error)
- func (c *Corpus) Season(ctx context.Context) (SeasonResponse, error)
- func (c *Corpus) Standings(ctx context.Context, params StandingsParams) (StandingsResponse, error)
- func (c *Corpus) TeamInfo(ctx context.Context, params TeamInfoParams) (TeamInfoResponse, error)
- func (c *Corpus) TeamStats(ctx context.Context, params TeamStatsParams) (TeamStatsResponse, error)
- func (c *Corpus) Timezone(ctx context.Context) (TimezoneResponse, error)
- func (c *Corpus) Venue(ctx context.Context, params VenueParams) (VenueResponse, error)
- func (c *Corpus) WithStale(stale bool) *Corpus
- type Country
- type CountryParams
- type CountryResponse
- type Doer
- type Event
- type EventParams
- type EventResponse
- type Fixture
- type FixtureInfoParams
- type FixtureInfoResponse
- type FixtureStatsParams
- type FixtureStatsResponse
- type GameTime
- type H2HTeam
- type Head2Head
- type Head2HeadParams
- type Head2HeadResponse
- type League
- type LeagueInfo
- type LeagueInfoParams
- type LeagueInfoResponse
- type Lineup
- type LineupParams
- type LineupResponse
- type PagingToken
- type Player
- type PlayerStats
- type PlayerStatsParams
- type PlayerStatsResponse
- type RankTotals
- type Ranking
- type Response
- type RoundParams
- type RoundResponse
- type SeasonResponse
- type StandingsParams
- type StandingsResponse
- type Statistics
- type TeamData
- type TeamInfo
- type TeamInfoParams
- type TeamInfoResponse
- type TeamStatsParams
- type TeamStatsResponse
- type TimezoneResponse
- type TotalPercent
- type TotalStr
- type Totals
- type Venue
- type VenueParams
- type VenueResponse
Constants ¶
View Source
const ( EP_Timezone = "/timezone" EP_Countries = "/countries" EP_Season = "/leagues/seasons" EP_LeagueInfo = "/leagues" EP_TeamInfo = "/teams" EP_TeamStats = "/teams/statistics" EP_Venue = "/venues" EP_Standings = "/standings" EP_Round = "/fixtures/rounds" EP_FixtureInfo = "/fixtures" EP_Head2Head = "/fixtures/headtohead" EP_FixtureStats = "/fixtures/statistics" EP_FixtureEvent = "/fixtures/events" EP_Lineup = "/fixtures/lineups" EP_PlayerStats = "/fixtures/players" )
View Source
const NoParams = ""
Variables ¶
View Source
var FballCacheSchema []byte
Functions ¶
func ToURLQueryString ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an api-football.com client.
type Corpus ¶
type Corpus struct {
// contains filtered or unexported fields
}
func (*Corpus) Country ¶
func (c *Corpus) Country(ctx context.Context, cp CountryParams) (CountryResponse, error)
func (*Corpus) Event ¶
func (c *Corpus) Event(ctx context.Context, params EventParams) (EventResponse, error)
func (*Corpus) FixtureInfo ¶
func (c *Corpus) FixtureInfo(ctx context.Context, params FixtureInfoParams) (FixtureInfoResponse, error)
func (*Corpus) FixtureStats ¶
func (c *Corpus) FixtureStats(ctx context.Context, params FixtureStatsParams) (FixtureStatsResponse, error)
func (*Corpus) Head2Head ¶
func (c *Corpus) Head2Head(ctx context.Context, params Head2HeadParams) (Head2HeadResponse, error)
func (*Corpus) LeagueInfo ¶
func (c *Corpus) LeagueInfo(ctx context.Context, params LeagueInfoParams) (LeagueInfoResponse, error)
func (*Corpus) Lineup ¶
func (c *Corpus) Lineup(ctx context.Context, params LineupParams) (LineupResponse, error)
func (*Corpus) PlayerStats ¶
func (c *Corpus) PlayerStats(ctx context.Context, params PlayerStatsParams) (PlayerStatsResponse, error)
func (*Corpus) Round ¶
func (c *Corpus) Round(ctx context.Context, params RoundParams) (RoundResponse, error)
func (*Corpus) Standings ¶
func (c *Corpus) Standings(ctx context.Context, params StandingsParams) (StandingsResponse, error)
func (*Corpus) TeamInfo ¶
func (c *Corpus) TeamInfo(ctx context.Context, params TeamInfoParams) (TeamInfoResponse, error)
func (*Corpus) TeamStats ¶
func (c *Corpus) TeamStats(ctx context.Context, params TeamStatsParams) (TeamStatsResponse, error)
func (*Corpus) Venue ¶
func (c *Corpus) Venue(ctx context.Context, params VenueParams) (VenueResponse, error)
type CountryParams ¶
type CountryResponse ¶
type CountryResponse struct { Country []Country `json:"response"` // contains filtered or unexported fields }
type EventResponse ¶
type EventResponse struct { Event []Event `json:"response"` // contains filtered or unexported fields }
type Fixture ¶
type Fixture struct { ID int `json:"id"` Referee string `json:"referee"` Timezone string `json:"timezone"` Date string `json:"date"` Timestamp int64 `json:"timestamp"` Periods struct { First int `json:"first"` Second int `json:"second"` } `json:"periods"` Venue Venue `json:"venue"` Status struct { Long string `json:"long"` Short string `json:"short"` Elapsed int `json:"elapsed"` } `json:"status"` }
type FixtureInfoParams ¶
type FixtureInfoResponse ¶
type FixtureInfoResponse struct { FixtureInfo []Head2Head `json:"response"` // contains filtered or unexported fields }
type FixtureStatsParams ¶
type FixtureStatsResponse ¶
type FixtureStatsResponse struct { Statistics []Statistics `json:"response"` // contains filtered or unexported fields }
type GameTime ¶
type GameTime struct { P15 TotalPercent `json:"0-15"` P30 TotalPercent `json:"16-30"` P45 TotalPercent `json:"31-45"` P60 TotalPercent `json:"46-60"` P75 TotalPercent `json:"61-75"` P90 TotalPercent `json:"76-90"` P105 TotalPercent `json:"91-105"` P120 TotalPercent `json:"105-120"` }
type Head2Head ¶
type Head2Head struct { Fixture Fixture `json:"fixture"` League League `json:"league"` Teams struct { Home H2HTeam `json:"home"` Away H2HTeam `json:"away"` } `json:"teams"` Goals Totals `json:"goals"` Score struct { Halftime Totals `json:"halftime"` Fulltime Totals `json:"fulltime"` Extratime Totals `json:"extratime"` Penalty Totals `json:"penalty"` } `json:"score"` }
type Head2HeadParams ¶
type Head2HeadResponse ¶
type Head2HeadResponse struct { Head2Head []Head2Head `json:"response"` // contains filtered or unexported fields }
type LeagueInfo ¶
type LeagueInfo struct { League League `json:"league"` Country Country `json:"country"` Seasons []struct { Year int `json:"year"` Start string `json:"start"` End string `json:"end"` Current bool `json:"current"` Coverage struct { Fixtures struct { Events bool `json:"events"` Lineups bool `json:"lineups"` StatisticsFixtures bool `json:"statistics_fixtures"` StatisticsPlayers bool `json:"statistics_players"` } `json:"fixtures"` Standings bool `json:"standings"` Players bool `json:"players"` TopScorers bool `json:"top_scorers"` TopAssists bool `json:"top_assists"` TopCards bool `json:"top_cards"` Predictions bool `json:"predictions"` Odds bool `json:"odds"` } `json:"coverage"` } `json:"seasons"` }
type LeagueInfoParams ¶
type LeagueInfoResponse ¶
type LeagueInfoResponse struct { LeagueInfo []LeagueInfo `json:"response"` // contains filtered or unexported fields }
type Lineup ¶
type Lineup struct { Team TeamData `json:"team"` Coach struct { ID int `json:"id"` Name string `json:"name"` Photo string `json:"photo"` } `json:"coach"` Formation string `json:"formation"` StartXI []struct { Player Player `json:"player"` } `json:"startXI"` Substitutes []struct { Player Player `json:"player"` } `json:"substitutes"` }
type LineupParams ¶
type LineupResponse ¶
type LineupResponse struct { Lineup []Lineup `json:"response"` // contains filtered or unexported fields }
type PagingToken ¶
type PlayerStats ¶
type PlayerStats struct { Team TeamData `json:"team"` Players []struct { Player Player `json:"player"` Statistics []struct { Games struct { Minutes int `json:"minutes"` Number int `json:"number"` Position string `json:"position"` Rating string `json:"rating"` Captain bool `json:"captain"` Substitute bool `json:"substitute"` } `json:"games"` Offsides interface{} `json:"offsides"` Shots struct { Total int `json:"total"` On int `json:"on"` } `json:"shots"` Goals struct { Total int `json:"total"` Conceded int `json:"conceded"` Assists int `json:"assists"` Saves int `json:"saves"` } `json:"goals"` Passes struct { Total int `json:"total"` Key int `json:"key"` Accuracy string `json:"accuracy"` } `json:"passes"` Tackles struct { Total int `json:"total"` Blocks int `json:"blocks"` Interceptions int `json:"interceptions"` } `json:"tackles"` Duels struct { Total int `json:"total"` Won int `json:"won"` } `json:"duels"` Dribbles struct { Attempts int `json:"attempts"` Success int `json:"success"` Past int `json:"past"` } `json:"dribbles"` Fouls struct { Drawn int `json:"drawn"` Committed int `json:"committed"` } `json:"fouls"` Cards struct { Yellow int `json:"yellow"` Red int `json:"red"` } `json:"cards"` Penalty struct { Won int `json:"won"` Commited int `json:"commited"` Scored int `json:"scored"` Missed int `json:"missed"` Saved int `json:"saved"` } `json:"penalty"` } `json:"statistics"` } `json:"players"` }
type PlayerStatsParams ¶
type PlayerStatsResponse ¶
type PlayerStatsResponse struct { PlayerStats []PlayerStats `json:"response"` // contains filtered or unexported fields }
type RankTotals ¶
type Ranking ¶
type Ranking struct { Rank int `json:"rank"` Team TeamData `json:"team"` Points int `json:"points"` Goalsdiff int `json:"goalsDiff"` Group string `json:"group"` Form string `json:"form"` Status string `json:"status"` Description string `json:"description"` All RankTotals `json:"all"` Home RankTotals `json:"home"` Away RankTotals `json:"away"` Update string `json:"update"` }
type Response ¶
type Response interface { // Err returns the error from the response, if any. Err() error // When returns the timestamp for the response. When() int64 // contains filtered or unexported methods }
Response is an interface for api-football.com responses.
type RoundParams ¶
type RoundResponse ¶
type RoundResponse struct { Rounds []string `json:"response"` // contains filtered or unexported fields }
type SeasonResponse ¶
type SeasonResponse struct { Season []int `json:"response"` // contains filtered or unexported fields }
type StandingsParams ¶
type StandingsResponse ¶
type StandingsResponse struct { Standings []struct { League League `json:"league"` } `json:"response"` // contains filtered or unexported fields }
type Statistics ¶
type TeamInfoParams ¶
type TeamInfoResponse ¶
type TeamInfoResponse struct { TeamInfo []TeamInfo `json:"response"` // contains filtered or unexported fields }
type TeamStatsParams ¶
type TeamStatsResponse ¶
type TeamStatsResponse struct { TeamStats struct { League League `json:"league"` Team TeamData `json:"team"` Form string `json:"form"` Fixtures struct { Played Totals `json:"played"` Wins Totals `json:"wins"` Draws Totals `json:"draws"` Loses Totals `json:"loses"` } `json:"fixtures"` Goals struct { For struct { Total Totals `json:"total"` Average TotalStr `json:"average"` Minute GameTime `json:"minute"` } `json:"for"` Against struct { Total Totals `json:"total"` Average TotalStr `json:"average"` Minute GameTime `json:"minute"` } `json:"against"` } `json:"goals"` Biggest struct { Streak struct { Wins int `json:"wins"` Draws int `json:"draws"` Loses int `json:"loses"` } `json:"streak"` Wins TotalStr `json:"wins"` Losev TotalStr `json:"loses"` Goals struct { For Totals `json:"for"` Against Totals `json:"against"` } `json:"goals"` } `json:"biggest"` CleanSheet Totals `json:"clean_sheet"` FailedToScore Totals `json:"failed_to_score"` Penalty struct { Scored TotalPercent `json:"scored"` Missed TotalPercent `json:"missed"` Total int `json:"total"` } `json:"penalty"` Lineups []struct { Formation string `json:"formation"` Played int `json:"played"` } `json:"lineups"` Cards struct { Yellow GameTime `json:"yellow"` Red GameTime `json:"red"` } `json:"cards"` } `json:"response"` // contains filtered or unexported fields }
type TimezoneResponse ¶
type TimezoneResponse struct { Timezone []string `json:"response"` // contains filtered or unexported fields }
type TotalPercent ¶
type VenueParams ¶
Click to show internal directories.
Click to hide internal directories.