Documentation ¶
Index ¶
- type API
- type Config
- type DetailedLiveRender
- type FontConfig
- type Game
- type OptionFunc
- type Server
- type SportBoard
- func (s *SportBoard) Enabler() board.Enabler
- func (s *SportBoard) GetHTTPHandlers() ([]*board.HTTPHandler, error)
- func (s *SportBoard) GetRPCHandler() (string, http.Handler)
- func (s *SportBoard) GridSize(bounds image.Rectangle) (int, int)
- func (s *SportBoard) HasPriority() bool
- func (s *SportBoard) InBetween() bool
- func (s *SportBoard) Name() string
- func (s *SportBoard) Render(ctx context.Context, canvas board.Canvas) error
- func (s *SportBoard) RenderGameCounter(canvas board.Canvas, numGames int, activeIndex int) (image.Image, error)
- func (s *SportBoard) RenderLeftLogo(ctx context.Context, canvasBounds image.Rectangle, teamID string) (image.Image, error)
- func (s *SportBoard) RenderRightLogo(ctx context.Context, canvasBounds image.Rectangle, teamID string) (image.Image, error)
- func (s *SportBoard) ScrollMode() bool
- func (s *SportBoard) SetLiveOnly(live bool)
- type Team
- type Todayer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { GetTeams(ctx context.Context) ([]Team, error) TeamFromID(ctx context.Context, abbreviation string) (Team, error) GetScheduledGames(ctx context.Context, date []time.Time) ([]Game, error) DateStr(d time.Time) string League() string HTTPPathPrefix() string GetLogo(ctx context.Context, logoKey string, logoConf *logo.Config, bounds image.Rectangle) (*logo.Logo, error) // AllTeamAbbreviations() []string GetWatchTeams(teams []string, season string) []string TeamRecord(ctx context.Context, team Team, season string) string TeamRank(ctx context.Context, team Team, season string) string CacheClear(ctx context.Context) HomeSideSwap() bool }
API ...
type Config ¶
type Config struct { TodayFunc Todayer TimeColor color.Color ScoreColor color.Color StartEnabled *atomic.Bool `json:"enabled"` BoardDelay string `json:"boardDelay"` FavoriteSticky *atomic.Bool `json:"favoriteSticky"` StickyDelay string `json:"stickyDelay"` ScoreFont *FontConfig `json:"scoreFont"` TimeFont *FontConfig `json:"timeFont"` LiveViewFont *FontConfig `json:"liveViewFont"` LogoConfigs []*logo.Config `json:"logoConfigs"` WatchTeams []string `json:"watchTeams"` FavoriteTeams []string `json:"favoriteTeams"` HideFavoriteScore *atomic.Bool `json:"hideFavoriteScore"` ShowRecord *atomic.Bool `json:"showRecord"` GridCols int `json:"gridCols"` GridRows int `json:"gridRows"` GridPadRatio float64 `json:"gridPadRatio"` MinimumGridWidth int `json:"minimumGridWidth"` MinimumGridHeight int `json:"minimumGridHeight"` Stats *statboard.Config `json:"stats"` Headlines *textboard.Config `json:"headlines"` ShowNoScheduledLogo *atomic.Bool `json:"showNotScheduled"` ScoreHighlightRepeat *int `json:"scoreHighlightRepeat"` OnTimes []string `json:"onTimes"` OffTimes []string `json:"offTimes"` UseGradient *atomic.Bool `json:"useGradient"` LiveOnly *atomic.Bool `json:"liveOnly"` ShowLeagueLogo *atomic.Bool `json:"showLeagueLogo"` Enable24Hour *atomic.Bool `json:"enable24Hour"` AdvanceDays int `json:"advanceDays"` PreviousDays int `json:"previousDays"` // contains filtered or unexported fields }
Config ...
type DetailedLiveRender ¶
type FontConfig ¶
FontConfig ...
type Game ¶
type Game interface { GetID() int GetLink() (string, error) IsLive() (bool, error) IsComplete() (bool, error) IsPostponed() (bool, error) HomeTeam() (Team, error) AwayTeam() (Team, error) GetQuarter() (string, error) // Or a period, inning GetClock() (string, error) GetUpdate(ctx context.Context) (Game, error) GetStartTime(ctx context.Context) (time.Time, error) GetOdds() (string, string, error) }
Game ...
type OptionFunc ¶
type OptionFunc func(s *SportBoard) error
func WithDetailedLiveRenderer ¶
func WithDetailedLiveRenderer(d DetailedLiveRender) OptionFunc
func WithLeagueLogoGetter ¶ added in v0.0.88
func WithLeagueLogoGetter(g logo.SourceGetter) OptionFunc
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server ...
type SportBoard ¶
SportBoard implements board.Board
func New ¶
func New(ctx context.Context, api API, bounds image.Rectangle, today *time.Time, logger *zap.Logger, config *Config, opts ...OptionFunc) (*SportBoard, error)
New ...
func (*SportBoard) Enabler ¶
func (s *SportBoard) Enabler() board.Enabler
func (*SportBoard) GetHTTPHandlers ¶
func (s *SportBoard) GetHTTPHandlers() ([]*board.HTTPHandler, error)
GetHTTPHandlers ...
func (*SportBoard) GetRPCHandler ¶
func (s *SportBoard) GetRPCHandler() (string, http.Handler)
GetRPCHandler ...
func (*SportBoard) GridSize ¶
func (s *SportBoard) GridSize(bounds image.Rectangle) (int, int)
GridSize returns the column width and row height for a grid layout. 0 is returned for both if the canvas is too small for a grid.
func (*SportBoard) RenderGameCounter ¶
func (s *SportBoard) RenderGameCounter(canvas board.Canvas, numGames int, activeIndex int) (image.Image, error)
RenderGameCounter ...
func (*SportBoard) RenderLeftLogo ¶
func (s *SportBoard) RenderLeftLogo(ctx context.Context, canvasBounds image.Rectangle, teamID string) (image.Image, error)
RenderLeftLogo ...
func (*SportBoard) RenderRightLogo ¶
func (s *SportBoard) RenderRightLogo(ctx context.Context, canvasBounds image.Rectangle, teamID string) (image.Image, error)
RenderRightLogo ...
func (*SportBoard) SetLiveOnly ¶
func (s *SportBoard) SetLiveOnly(live bool)
SetLiveOnly sets this board to show only live games or not
Click to show internal directories.
Click to hide internal directories.