stats

package
v1.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boxscore

type Boxscore struct {
	GameID   string `json:"game_id"`
	HomeTeam Team   `json:"home_team"`
	AwayTeam Team   `json:"away_team"`
}

func NewBoxscore

func NewBoxscore(bs nba.BoxscoreData) Boxscore

type Game

type Game struct {
	ID       string       `json:"id"`
	StartsAt nba.GameTime `json:"starts_at"`
	HomeTeam Team         `json:"home_team"`
	AwayTeam Team         `json:"away_team"`
}

type Player

type Player struct {
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Position  string `json:"position"`
	Stats     Stats  `json:"stats"`
}

type Provider

type Provider interface {
	GetScoreboard(context.Context, nba.GetScoreboardCommand) (Scoreboard, error)
	GetBoxscore(context.Context, nba.GetBoxscoreCommand) (Boxscore, error)
}

type Scoreboard

type Scoreboard struct {
	Date  nba.GameDate `json:"date"`
	Games []Game       `json:"games"`
}

func NewScoreboard

func NewScoreboard(sb nba.ScoreboardData) Scoreboard

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(a nba.API) *Service

func (*Service) GetBoxscore

func (s *Service) GetBoxscore(ctx context.Context, cmd nba.GetBoxscoreCommand) (Boxscore, error)

func (*Service) GetScoreboard

func (s *Service) GetScoreboard(ctx context.Context, cmd nba.GetScoreboardCommand) (Scoreboard, error)

type Stats

type Stats struct {
	Minutes   string  `json:"min"`
	FGM       int64   `json:"fgm"`
	FGA       int64   `json:"fga"`
	FGP       float64 `json:"fgp"`
	ThreeFGM  int64   `json:"3fgm"`
	ThreeFGA  int64   `json:"3fga"`
	ThreeFGP  float64 `json:"3fgp"`
	FTM       int64   `json:"ftm"`
	FTA       int64   `json:"fta"`
	FTP       float64 `json:"ftp"`
	RO        int64   `json:"oreb"`
	RD        int64   `json:"dreb"`
	RT        int64   `json:"reb"`
	RTeam     int64   `json:"rebt"`
	AST       int64   `json:"ast"`
	STL       int64   `json:"stl"`
	BLK       int64   `json:"blk"`
	TO        int64   `json:"to"`
	TOT       int64   `json:"tot"`
	FP        int64   `json:"pf"`
	FD        int64   `json:"fd"`
	PT        int64   `json:"pts"`
	PlusMinus float64 `json:"plus_minus"`
}

type Team

type Team struct {
	ID      int64    `json:"id"`
	Name    string   `json:"name"`
	Tricode string   `json:"tricode"`
	Stats   Stats    `json:"stats"`
	Players []Player `json:"players,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL