Documentation ¶
Index ¶
- Constants
- Variables
- func GetLiveGame(ctx context.Context, link string) (sportboard.Game, error)
- type DefaultLogoConfigs
- type Game
- func (g *Game) AwayTeam() (sportboard.Team, error)
- func (g *Game) GetClock() (string, error)
- func (g *Game) GetID() int
- func (g *Game) GetLink() (string, error)
- func (g *Game) GetQuarter() (string, error)
- func (g *Game) GetStartTime(ctx context.Context) (time.Time, error)
- func (g *Game) GetUpdate(ctx context.Context) (sportboard.Game, error)
- func (g *Game) HomeTeam() (sportboard.Team, error)
- func (g *Game) IsComplete() (bool, error)
- func (g *Game) IsLive() (bool, error)
- func (g *Game) IsPostponed() (bool, error)
- type LiveGameGetter
- type MLB
- func (m *MLB) AllTeamAbbreviations() []string
- func (m *MLB) CacheClear(ctx context.Context)
- func (m *MLB) DateStr(d time.Time) string
- func (m *MLB) GetLogo(ctx context.Context, logoKey string, logoConf *logo.Config, ...) (*logo.Logo, error)
- func (m *MLB) GetScheduledGames(ctx context.Context, date time.Time) ([]sportboard.Game, error)
- func (m *MLB) GetTeams(ctx context.Context) ([]sportboard.Team, error)
- func (m *MLB) GetWatchTeams(teams []string) []string
- func (m *MLB) HTTPPathPrefix() string
- func (m *MLB) League() string
- func (m *MLB) TeamFromAbbreviation(ctx context.Context, abbreviation string) (sportboard.Team, error)
- func (m *MLB) TeamRank(ctx context.Context, team sportboard.Team) string
- func (m *MLB) TeamRecord(ctx context.Context, team sportboard.Team) string
- func (m *MLB) UpdateGames(ctx context.Context, dateStr string) error
- func (m *MLB) UpdateTeams(ctx context.Context) error
- type Team
Constants ¶
View Source
const ( // ARI ... ARI = "ARI" // ATL ... ATL = "ATL" // BAL ... BAL = "BAL" // BOS ... BOS = "BOS" // CHC ... CHC = "CHC" // CIN ... CIN = "CIN" // CLE ... CLE = "CLE" // COL ... COL = "COL" // CWS ... CWS = "CWS" // DET ... DET = "DET" // HOU ... HOU = "HOU" // KC ... KC = "KC" // LAA ... LAA = "LAA" // LAD ... LAD = "LAD" // MIA ... MIA = "MIA" // MIL ... MIL = "MIL" // MIN ... MIN = "MIN" // NYM ... NYM = "NYM" // NYY ... NYY = "NYY" // OAK ... OAK = "OAK" // PHI ... PHI = "PHI" // PIT ... PIT = "PIT" // SD ... SD = "SD" // SEA ... SEA = "SEA" // SF ... SF = "SF" // STL ... STL = "STL" // TB ... TB = "TB" // TEX ... TEX = "TEX" // TOR ... TOR = "TOR" // WSH ... WSH = "WSH" )
View Source
const (
// DateFormat is the game schedule format for querying a particular day from the API
DateFormat = "2006-01-02"
)
Variables ¶
View Source
var ALL = []string{ARI, ATL, BAL, BOS, CHC, CIN, CLE, COL, CWS, DET, HOU, KC, LAA, LAD, MIA, MIL, MIN, NYM, NYY, OAK, PHI, PIT, SD, SEA, SF, STL, TB, TEX, TOR, WSH}
ALL contains all of the teams in the league
Functions ¶
func GetLiveGame ¶
GetLiveGame ...
Types ¶
type DefaultLogoConfigs ¶ added in v0.0.3
DefaultLogoConfigs contains default logo alignedment configurations
type Game ¶
type Game struct { GameGetter LiveGameGetter ID int `json:"gamePk"` Link string `json:"link"` Teams *struct { Home *gameTeam `json:"home"` Away *gameTeam `json:"away"` } `json:"teams"` GameTime time.Time GameDate string `json:"gameDate"` GameData *struct { DateTime *struct { DateTime string `json:"dateTime,omitempty"` } `json:"datetime,omitempty"` Status *struct { AbstractGameState string `json:"abstractGameState,omitempty"` DetailedState string `json:"detailedState,omitempty"` StatusCode string `json:"statusCode,omitempty"` } `json:"status,omitempty"` Teams *struct { Home *Team `json:"home"` Away *Team `json:"away"` } `json:"teams"` } `json:"gameData,omitempty"` LiveData *struct { Linescore *struct { CurrentInning int `json:"currentInning"` CurrentInningOrdinal string `json:"currentInningOrdinal"` InningState string `json:"inningState"` Teams *struct { Home *gameTeam `json:"home"` Away *gameTeam `json:"away"` } `json:"teams"` } `json:"linescore"` } `json:"liveData"` }
Game ...
func (*Game) GetStartTime ¶
GetStartTime ...
func (*Game) IsPostponed ¶ added in v0.0.7
IsPostponed ...
type LiveGameGetter ¶
LiveGameGetter is a func used to retrieve an updated sportboard.Game
type MLB ¶
MLB implements a sportboard.API
func (*MLB) AllTeamAbbreviations ¶
AllTeamAbbreviations returns a list of all teams in the league
func (*MLB) CacheClear ¶ added in v0.0.15
CacheClear ...
func (*MLB) GetLogo ¶
func (m *MLB) GetLogo(ctx context.Context, logoKey string, logoConf *logo.Config, bounds image.Rectangle) (*logo.Logo, error)
GetLogo ...
func (*MLB) GetScheduledGames ¶
GetScheduledGames ...
func (*MLB) GetWatchTeams ¶ added in v0.0.12
GetWatchTeams parses 'ALL' or divisions and adds teams accordingly
func (*MLB) HTTPPathPrefix ¶
HTTPPathPrefix returns the path prefix for the HTTP handlers for this board
func (*MLB) TeamFromAbbreviation ¶
func (m *MLB) TeamFromAbbreviation(ctx context.Context, abbreviation string) (sportboard.Team, error)
TeamFromAbbreviation ...
func (*MLB) TeamRecord ¶ added in v0.0.13
TeamRecord ...
func (*MLB) UpdateGames ¶
UpdateGames updates scheduled games
type Team ¶
type Team struct { ID int `json:"id"` Name string `json:"name"` Abbreviation string `json:"abbreviation"` Link string `json:"link,omitempty"` DivisionData struct { ID int `json:"id"` Name string `json:"name"` Link string `json:"link"` } `json:"division"` Division *division Runs int }
Team implements a sportboard.Team
Click to show internal directories.
Click to hide internal directories.