Documentation ¶
Index ¶
- Constants
- Variables
- func GetLiveGame(ctx context.Context, link string) (sportboard.Game, error)
- func GetSeason(day time.Time) string
- 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) GetOdds() (string, 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 NHL
- func (n *NHL) AllTeamAbbreviations() []string
- func (n *NHL) AvailableStats(ctx context.Context, category string) ([]string, error)
- func (n *NHL) CacheClear(ctx context.Context)
- func (n *NHL) DateStr(d time.Time) string
- func (n *NHL) FindPlayer(ctx context.Context, first string, last string) (statboard.Player, error)
- func (n *NHL) Games(dateStr string) ([]*Game, error)
- func (n *NHL) GetLogo(ctx context.Context, logoKey string, logoConf *logo.Config, ...) (*logo.Logo, error)
- func (n *NHL) GetPlayer(ctx context.Context, id string) (statboard.Player, error)
- func (n *NHL) GetScheduledGames(ctx context.Context, dates []time.Time) ([]sportboard.Game, error)
- func (n *NHL) GetTeams(ctx context.Context) ([]sportboard.Team, error)
- func (n *NHL) GetWatchTeams(teams []string, season string) []string
- func (n *NHL) HTTPPathPrefix() string
- func (n *NHL) League() string
- func (n *NHL) LeagueShortName() string
- func (n *NHL) ListPlayers(ctx context.Context, teamAbbreviation string) ([]statboard.Player, error)
- func (n *NHL) PlayerCategories() []string
- func (n *NHL) StatShortName(stat string) string
- func (n *NHL) TeamFromAbbreviation(ctx context.Context, abbreviation string) (sportboard.Team, error)
- func (n *NHL) TeamRank(ctx context.Context, team sportboard.Team, season string) string
- func (n *NHL) TeamRecord(ctx context.Context, team sportboard.Team, season string) string
- func (n *NHL) UpdateGames(ctx context.Context, dateStr string) error
- func (n *NHL) UpdateTeams(ctx context.Context) error
- type Player
- func (p *Player) FirstName() string
- func (p *Player) GetCategory() string
- func (p *Player) GetStat(stat string) string
- func (p *Player) LastName() string
- func (p *Player) Position() string
- func (p *Player) PrefixCol() string
- func (p *Player) StatColor(stat string) color.Color
- func (p *Player) UpdateStats(ctx context.Context) error
- type Team
Constants ¶
const ( // ANA ... ANA = "ANA" // ARI ... ARI = "ARI" // BOS ... BOS = "BOS" // BUF ... BUF = "BUF" // CAR ... CAR = "CAR" // CBJ ... CBJ = "CBJ" // CGY ... CGY = "CGY" // CHI ... CHI = "CHI" // COL ... COL = "COL" // DAL ... DAL = "DAL" // DET ... DET = "DET" // EDM ... EDM = "EDM" // FLA ... FLA = "FLA" // LAK ... LAK = "LAK" // MIN ... MIN = "MIN" // MTL ... MTL = "MTL" // NJD ... NJD = "NJD" // NSH ... NSH = "NSH" // NYI ... NYI = "NYI" // NYR ... NYR = "NYR" // OTT ... OTT = "OTT" // PHI ... PHI = "PHI" // PIT ... PIT = "PIT" // SJS ... SJS = "SJS" // STL ... STL = "STL" // TBL ... TBL = "TBL" // TOR ... TOR = "TOR" // VAN ... VAN = "VAN" // VGK ... VGK = "VGK" // WPG ... WPG = "WPG" // WSH ... WSH = "WSH" )
const (
// DateFormat ...
DateFormat = "2006-01-02"
)
Variables ¶
var ALL = []string{ANA, ARI, BOS, BUF, CAR, CBJ, CGY, CHI, COL, DAL, DET, EDM, FLA, LAK, MIN, MTL, NJD, NSH, NYI, NYR, OTT, PHI, PIT, SJS, STL, TBL, TOR, VAN, VGK, WPG, WSH}
ALL is a list of all teams in the league
Functions ¶
func GetLiveGame ¶
GetLiveGame is a LiveGameGetter
Types ¶
type Game ¶
type Game struct { GameGetter LiveGameGetter ID int `json:"gamePk"` Link string `json:"link"` Teams *struct { Away *gameTeam `json:"away"` Home *gameTeam `json:"home"` } `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"` } `json:"status,omitempty"` } `json:"gameData,omitempty"` LiveData *struct { Linescore *struct { Teams *struct { Home *gameTeam `json:"home"` Away *gameTeam `json:"away"` } `json:"teams"` CurrentPeriod int `json:"currentPeriod,omitempty"` CurrentPeriodOrdinal string `json:"currentPeriodOrdinal"` CurrentPeriodTimeRemaining string `json:"currentPeriodTimeRemaining,omitempty"` } `json:"linescore"` } `json:"liveData"` }
Game implements sportboard.Game
func (*Game) GetStartTime ¶
GetStartTime ...
func (*Game) IsPostponed ¶ added in v0.0.7
IsPostponed ...
type LiveGameGetter ¶
LiveGameGetter retrieves a live game from a game link
type NHL ¶
NHL implements sportboard.API
func (*NHL) AllTeamAbbreviations ¶
AllTeamAbbreviations ...
func (*NHL) AvailableStats ¶ added in v0.0.18
AvailableStats ...
func (*NHL) CacheClear ¶ added in v0.0.15
CacheClear ...
func (*NHL) FindPlayer ¶ added in v0.0.18
FindPlayer ...
func (*NHL) GetLogo ¶
func (n *NHL) GetLogo(ctx context.Context, logoKey string, logoConf *logo.Config, bounds image.Rectangle) (*logo.Logo, error)
GetLogo ...
func (*NHL) GetScheduledGames ¶
GetScheduledGames ...
func (*NHL) GetWatchTeams ¶ added in v0.0.12
GetWatchTeams ...
func (*NHL) HTTPPathPrefix ¶
HTTPPathPrefix returns the prefix of HTTP calls to this board. i.e. /nhl/foo
func (*NHL) LeagueShortName ¶ added in v0.0.18
LeagueShortName ...
func (*NHL) ListPlayers ¶ added in v0.0.18
ListPlayers ...
func (*NHL) PlayerCategories ¶ added in v0.0.18
PlayerCategories returns the possible categories a player falls into
func (*NHL) StatShortName ¶ added in v0.0.18
StatShortName returns a short name representation of the stat, if any
func (*NHL) TeamFromAbbreviation ¶
func (n *NHL) TeamFromAbbreviation(ctx context.Context, abbreviation string) (sportboard.Team, error)
TeamFromAbbreviation ...
func (*NHL) TeamRecord ¶ added in v0.0.13
TeamRecord ...
func (*NHL) UpdateGames ¶
UpdateGames ...
type Player ¶ added in v0.0.18
type Player struct { Person struct { ID int64 `json:"id"` FullName string `json:"fullName"` Link string `json:"link"` } `json:"person"` PlayerPosition *struct { Abbreviation string `json:"abbreviation"` Name string `json:"name"` } `json:"position"` Stats *playerStats }
Player ...
func (*Player) GetCategory ¶ added in v0.0.18
GetCategory returns the player's catgeory: skater or goalie
type Team ¶
type Team struct { ID int `json:"id"` Name string `json:"name"` Abbreviation string `json:"abbreviation"` NextGameSchedule *struct { Dates []*struct { Games []*Game `json:"games"` } `json:"dates"` } `json:"nextGameSchedule,omitempty"` DivisionData struct { ID int `json:"id"` } `json:"division"` Roster struct { Roster []*Player `json:"roster"` } `json:"roster"` Division *division // contains filtered or unexported fields }
Team implements sportboard.Team
func (*Team) ConferenceName ¶ added in v0.0.41
ConferenceName ...
func (*Team) GetDisplayName ¶ added in v0.0.41
GetDisplayName ...