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) GetPlayerStatsData(year string, playerId 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(year string) (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) GetPlayerStats(year string, playerId string) (AverageStats, error)
- func (c Client) GetPlayers(year string) ([]Player, error)
- func (c Client) GetTeams(year string) ([]Team, error)
- type Game
- type Player
- type Position
- type Stats
- type Team
Constants ¶
const NBA_DATA_ENDPOINT = "https://data.nba.net/data/10s/prod/v1"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApiClient ¶ added in v1.2.0
type ApiClient struct {
Url string
}
func NewApiClient ¶ added in v1.2.0
func (ApiClient) GetBoxscoreData ¶ added in v1.2.0
GetBoxscoreData returns the boxscore from a given date and game identifier
func (ApiClient) GetPlayerStatsData ¶ added in v1.2.0
GetPlayerStatsData returns the list of statistics of a player until the given season (year)
func (ApiClient) GetPlayersData ¶ added in v1.2.0
GetPlayersData returns the list of players for a given season (year)
func (ApiClient) GetScoreboardData ¶ added in v1.2.0
GetScoreboardData returns the scoreboard from a given date
type AverageStats ¶ added in v1.2.0
type Client ¶ added in v1.2.0
type Client struct {
ApiClient ApiClient
}
func (Client) GetBoxscore ¶ added in v1.2.0
GetBoxscore returns the boxscore of a game between two teams that was played from a given date
func (Client) GetBoxscores ¶ added in v1.2.0
GetBoxscores returns the list of boxscores that was played from a given date
func (Client) GetGames ¶ added in v1.2.0
GetGames returns the list of games that was played from a given date
func (Client) GetPlayerStats ¶ added in v1.2.0
func (c Client) GetPlayerStats(year string, playerId string) (AverageStats, error)
GetPlayerStats returns the average stats of a player for the given season (ex 2021 for season 2021/2022)
func (Client) GetPlayers ¶ added in v1.2.0
GetPlayers returns the list of players in a given season (ex 2021 for season 2021/2022)
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