Documentation ¶
Index ¶
- Constants
- func GetMockServer(t *testing.T) *httptest.Server
- type ApiClient
- func (c ApiClient) GetBoxscoreData(date string, gameId string) (map[string]interface{}, error)
- func (c ApiClient) GetCurrentPlayersData() (map[string]interface{}, error)
- func (c ApiClient) GetPlayerData(firstName string, lastName string) (map[string]interface{}, error)
- func (c ApiClient) GetPlayersData(year string) (map[string]interface{}, error)
- func (c ApiClient) GetScoreboardData(date string) (map[string]interface{}, error)
- func (c ApiClient) GetTeamsData() (map[string]interface{}, error)
- type ApiV2Client
- func (c ApiV2Client) GetBoxscoreData(date string, gameId string) (map[string]interface{}, error)
- func (c ApiV2Client) GetCurrentPlayersData() (map[string]interface{}, error)
- func (c ApiV2Client) GetPlayerData(firstName string, lastName string) (map[string]interface{}, error)
- func (c ApiV2Client) GetPlayerDataByID(ID string) (map[string]interface{}, error)
- func (c ApiV2Client) GetPlayersData(year string) (map[string]interface{}, error)
- func (c ApiV2Client) GetScoreboardData(date string) (map[string]interface{}, error)
- func (c ApiV2Client) GetTeamsData() (map[string]interface{}, error)
- type AverageStats
- type Boxscore
- type Client
- func (c Client) GetBoxscore(date string, homeTeam string, visitorTeam string) (Boxscore, error)
- func (c Client) GetBoxscores(date string) ([]Boxscore, error)
- func (c Client) GetGames(date string) ([]Game, error)
- func (c Client) GetPlayers(year string) ([]Player, error)
- func (c Client) GetTeams() ([]Team, error)
- type ClientV2
- func (c ClientV2) GetBoxscore(date string, homeTeam string, visitorTeam string) (Boxscore, error)
- func (c ClientV2) GetBoxscores(date string) ([]Boxscore, error)
- func (c ClientV2) GetGames(date string) ([]Game, error)
- func (c ClientV2) GetPlayers() ([]Player, error)
- func (c ClientV2) GetTeams() ([]Team, error)
- type Game
- type Player
- type Position
- type Stats
- type Team
Constants ¶
const NBA_DATA_ENDPOINT = "https://www.balldontlie.io/api/v1"
const NBA_DATA_ENDPOINT_V2 = "https://tank01-fantasy-stats.p.rapidapi.com"
const NBA_PLAYERS_DATA_ENDPOINT = "https://data.nba.net/data/10s/prod/v1"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApiClient ¶
func NewApiClient ¶
func (ApiClient) GetBoxscoreData ¶
GetBoxscoreData returns the boxscore from a given date and game identifier
func (ApiClient) GetCurrentPlayersData ¶ added in v2.1.0
GetPlayersData returns the list of players for current season
func (ApiClient) GetPlayerData ¶
GetPlayerData returns the list of players for a given season (year)
func (ApiClient) GetPlayersData ¶
GetPlayersData returns the list of players for a given season (year)
func (ApiClient) GetScoreboardData ¶
GetScoreboardData returns the scoreboard from a given date
func (ApiClient) GetTeamsData ¶
GetTeamsData returns the list of teams for the current season
type ApiV2Client ¶ added in v2.1.0
func NewApiV2Client ¶ added in v2.1.0
func NewApiV2Client(url string, apiKey string, apiHost string) ApiV2Client
func NewDefaultApiV2Client ¶ added in v2.1.0
func NewDefaultApiV2Client(apiKey string, apiHost string) ApiV2Client
func (ApiV2Client) GetBoxscoreData ¶ added in v2.1.0
func (c ApiV2Client) GetBoxscoreData(date string, gameId string) (map[string]interface{}, error)
GetBoxscoreData returns the boxscore from a given date and game identifier
func (ApiV2Client) GetCurrentPlayersData ¶ added in v2.1.0
func (c ApiV2Client) GetCurrentPlayersData() (map[string]interface{}, error)
GetCurrentPlayersData returns the list of players for current season
func (ApiV2Client) GetPlayerData ¶ added in v2.1.0
func (c ApiV2Client) GetPlayerData(firstName string, lastName string) (map[string]interface{}, error)
GetPlayerData returns the given player info from first and last name
func (ApiV2Client) GetPlayerDataByID ¶ added in v2.1.0
func (c ApiV2Client) GetPlayerDataByID(ID string) (map[string]interface{}, error)
GetPlayerData returns the given player info from its ID
func (ApiV2Client) GetPlayersData ¶ added in v2.1.0
func (c ApiV2Client) GetPlayersData(year string) (map[string]interface{}, error)
GetPlayersData returns the list of players for a given season (year)
func (ApiV2Client) GetScoreboardData ¶ added in v2.1.0
func (c ApiV2Client) GetScoreboardData(date string) (map[string]interface{}, error)
GetScoreboardData returns the scoreboard from a given date
func (ApiV2Client) GetTeamsData ¶ added in v2.1.0
func (c ApiV2Client) GetTeamsData() (map[string]interface{}, error)
GetTeamsData returns the list of teams for the current season
type AverageStats ¶
type Client ¶
type Client struct {
ApiClient ApiClient
}
func (Client) GetBoxscore ¶
GetBoxscore returns the boxscore of a game between two teams that was played from a given date
func (Client) GetBoxscores ¶
GetBoxscores returns the list of boxscores that was played from a given date
func (Client) GetPlayers ¶
GetPlayers returns the list of players in a given season (ex 2021 for season 2021/2022)
type ClientV2 ¶ added in v2.1.0
type ClientV2 struct {
ApiV2Client ApiV2Client
}
func NewClientV2 ¶ added in v2.1.0
func NewDefaultClientV2 ¶ added in v2.1.0
func (ClientV2) GetBoxscore ¶ added in v2.1.0
GetBoxscore returns the boxscore of a game between two teams that was played from a given date
func (ClientV2) GetBoxscores ¶ added in v2.1.0
GetBoxscores returns the list of boxscores that was played from a given date
func (ClientV2) GetGames ¶ added in v2.1.0
GetGames returns the list of games that was played from a given date
func (ClientV2) GetPlayers ¶ added in v2.1.0
GetPlayers returns the list of players for current season
type Stats ¶
type Stats struct { PlayerID string FirstName string LastName string TeamID string Points int Rebounds int Assists int Blocks int Steals int Turnovers int Fouls int FGM int // Field goal made FGA int // Field goal attempted TPM int // Three points made TPA int // Three points attempted FTM int // Free throw made FTA int // Free throw attempted }
Stats represents the statistics of a player