espnboard

package
v0.0.43 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const DateFormat = "20060102"

DateFormat for getting games

Variables

This section is empty.

Functions

func TimeToGameDateStr

func TimeToGameDateStr(t time.Time) string

TimeToGameDateStr converts a time.Time into the date string format the API expects

Types

type Conference

type Conference struct {
	Name         string
	Abbreviation string
}

Conference ...

type ESPNBoard

type ESPNBoard struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ESPNBoard ...

func New

func New(ctx context.Context, leaguer Leaguer, logger *zap.Logger, r rankSetter) (*ESPNBoard, error)

New ...

func NewEPL added in v0.0.43

func NewEPL(ctx context.Context, logger *zap.Logger) (*ESPNBoard, error)

NewEPL ...

func NewMLB added in v0.0.38

func NewMLB(ctx context.Context, logger *zap.Logger) (*ESPNBoard, error)

NewMLB ...

func NewMLS

func NewMLS(ctx context.Context, logger *zap.Logger) (*ESPNBoard, error)

NewMLS ...

func NewNBA

func NewNBA(ctx context.Context, logger *zap.Logger) (*ESPNBoard, error)

NewNBA ...

func NewNCAAF added in v0.0.41

func NewNCAAF(ctx context.Context, logger *zap.Logger) (*ESPNBoard, error)

NewNCAAF ...

func NewNCAAMensBasketball

func NewNCAAMensBasketball(ctx context.Context, logger *zap.Logger) (*ESPNBoard, error)

NewNCAAMensBasketball ...

func NewNFL

func NewNFL(ctx context.Context, logger *zap.Logger) (*ESPNBoard, error)

NewNFL ...

func NewNHL added in v0.0.38

func NewNHL(ctx context.Context, logger *zap.Logger) (*ESPNBoard, error)

NewNHL ...

func (*ESPNBoard) AllTeamAbbreviations

func (e *ESPNBoard) AllTeamAbbreviations() []string

AllTeamAbbreviations ...

func (*ESPNBoard) CacheClear

func (e *ESPNBoard) CacheClear(ctx context.Context)

CacheClear ...

func (*ESPNBoard) DateStr

func (e *ESPNBoard) DateStr(d time.Time) string

DateStr ...

func (*ESPNBoard) GetGames

func (e *ESPNBoard) GetGames(ctx context.Context, dateStr string) ([]*Game, error)

GetGames gets the games for a given date

func (e *ESPNBoard) GetLogo(ctx context.Context, logoKey string, logoConf *logo.Config, bounds image.Rectangle) (*logo.Logo, error)

GetLogo ...

func (*ESPNBoard) GetLogoSource

func (e *ESPNBoard) GetLogoSource(ctx context.Context, teamAbbreviation string, logoURLSearch string) (image.Image, error)

GetLogoSource ...

func (*ESPNBoard) GetScheduledGames

func (e *ESPNBoard) GetScheduledGames(ctx context.Context, date time.Time) ([]sportboard.Game, error)

GetScheduledGames ...

func (*ESPNBoard) GetTeams

func (e *ESPNBoard) GetTeams(ctx context.Context) ([]sportboard.Team, error)

GetTeams ...

func (*ESPNBoard) GetWatchTeams

func (e *ESPNBoard) GetWatchTeams(teams []string) []string

GetWatchTeams ...

func (*ESPNBoard) HTTPPathPrefix

func (e *ESPNBoard) HTTPPathPrefix() string

HTTPPathPrefix ...

func (*ESPNBoard) League

func (e *ESPNBoard) League() string

League ...

func (*ESPNBoard) TeamFromAbbreviation

func (e *ESPNBoard) TeamFromAbbreviation(ctx context.Context, abbreviation string) (sportboard.Team, error)

TeamFromAbbreviation ...

func (*ESPNBoard) TeamRank

func (e *ESPNBoard) TeamRank(ctx context.Context, team sportboard.Team) string

TeamRank ...

func (*ESPNBoard) TeamRecord

func (e *ESPNBoard) TeamRecord(ctx context.Context, team sportboard.Team) string

TeamRecord ...

func (*ESPNBoard) TeamsInConference

func (e *ESPNBoard) TeamsInConference(conference string) []string

TeamsInConference ...

func (*ESPNBoard) UpdateGames

func (e *ESPNBoard) UpdateGames(ctx context.Context, dateStr string) error

UpdateGames ...

type Game

type Game struct {
	ID       string
	Home     *Team
	Away     *Team
	GameTime time.Time
	// contains filtered or unexported fields
}

Game ...

func (*Game) AwayTeam

func (g *Game) AwayTeam() (sportboard.Team, error)

AwayTeam ...

func (*Game) GetClock

func (g *Game) GetClock() (string, error)

GetClock ...

func (*Game) GetID

func (g *Game) GetID() int

GetID ...

func (g *Game) GetLink() (string, error)

GetLink ...

func (*Game) GetOdds added in v0.0.38

func (g *Game) GetOdds() (string, string, error)

GetOdds ...

func (*Game) GetQuarter

func (g *Game) GetQuarter() (string, error)

GetQuarter ...

func (*Game) GetStartTime

func (g *Game) GetStartTime(ctx context.Context) (time.Time, error)

GetStartTime ...

func (*Game) GetUpdate

func (g *Game) GetUpdate(ctx context.Context) (sportboard.Game, error)

GetUpdate ...

func (*Game) HomeTeam

func (g *Game) HomeTeam() (sportboard.Team, error)

HomeTeam ...

func (*Game) IsComplete

func (g *Game) IsComplete() (bool, error)

IsComplete ...

func (*Game) IsLive

func (g *Game) IsLive() (bool, error)

IsLive ...

func (*Game) IsPostponed

func (g *Game) IsPostponed() (bool, error)

IsPostponed ...

type Leaguer

type Leaguer interface {
	League() string
	APIPath() string
	TeamEndpoints() []string
	HTTPPathPrefix() string
}

Leaguer ...

type Logo struct {
	Href  string `json:"href"`
	Width int    `json:"width"`
	Heigh int    `json:"height"`
}

Logo ...

type Odds added in v0.0.38

type Odds struct {
	Provider *struct {
		ID       string `json:"id"`
		Name     string `json:"name"`
		Priority int    `json:"priority"`
	} `json:"provider"`
	Details   string  `json:"details"`
	OverUnder float64 `json:"overUnder"`
}

Odds represents a game's betting odds

type Team

type Team struct {
	ID           string  `json:"id"`
	Name         string  `json:"name"`
	DisplayName  string  `json:"displayName"`
	Abbreviation string  `json:"abbreviation"`
	Color        string  `json:"color"`
	Logos        []*Logo `json:"logos"`
	Points       string  `json:"score"`
	LogoURL      string  `json:"logo"`
	Conference   *Conference
	IsHome       bool

	sync.Mutex
	// contains filtered or unexported fields
}

Team implements sportboard.Team

func (*Team) ConferenceName added in v0.0.41

func (t *Team) ConferenceName() string

ConferenceName ...

func (*Team) GetAbbreviation

func (t *Team) GetAbbreviation() string

GetAbbreviation ...

func (*Team) GetDisplayName added in v0.0.41

func (t *Team) GetDisplayName() string

GetDisplayName ...

func (*Team) GetID

func (t *Team) GetID() int

GetID ...

func (*Team) GetName

func (t *Team) GetName() string

GetName ...

func (*Team) Score

func (t *Team) Score() int

Score ...

Jump to

Keyboard shortcuts

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