games

package
v0.0.0-...-85481a0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Competition

type Competition int
const (
	NFL Competition = iota
	CFL
	NCAA
)

func GetCompetitions

func GetCompetitions() []Competition

type Game

type Game struct {
	Id          string
	Start       time.Time
	Name        string
	Venue       Venue
	Status      GameStatus
	Weather     GameWeather
	HomeTeam    TeamScore
	AwayTeam    TeamScore
	WeekName    string
	Competition Competition
}

type GameChange

type GameChange int
const (
	NoChanges GameChange = iota
	NewGame
	Started
	Rescheduled
	HomeScore
	AwayScore
	PeriodFinished
	Finished
)

type GameHandler

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

func (*GameHandler) GetGame

func (gh *GameHandler) GetGame(id string) (Game, error)

func (*GameHandler) GetGames

func (gh *GameHandler) GetGames(c Competition) []Game

func (*GameHandler) GetGamesStartingIn

func (gh *GameHandler) GetGamesStartingIn(c Competition, d time.Duration) []Game

func (*GameHandler) UpdateGamesInformation

func (gh *GameHandler) UpdateGamesInformation(onlyPlaying bool)

func (*GameHandler) UpdateGamesList

func (gh *GameHandler) UpdateGamesList()

type GameInfoClient

type GameInfoClient interface {
	GetGames(Competition) ([]Game, error)
	GetGameInformation(Competition, string) (Game, error)
}

type GameState

type GameState int
const (
	ScheduledState GameState = iota
	RescheduledState
	InProgressState
	FinishedState
	CancelledState
)

type GameStatus

type GameStatus struct {
	Clock        float64
	DisplayClock string
	Period       int
	State        GameState
}

type GameWeather

type GameWeather struct {
	DisplayValue string
	Temperature  int
}

type Handler

type Handler interface {
	GetGames(c Competition) []Game
	GetGamesStartingIn(c Competition, d time.Duration) []Game
	GetGame(id string) (Game, error)
	UpdateGamesInformation(onlyPlaying bool)
	UpdateGamesList()
}

func NewGameHandler

func NewGameHandler(client GameInfoClient, getGames bool, queue pubsub.Queue, clk clock.Clock) Handler

type TeamScore

type TeamScore struct {
	Score            int
	Name             string
	ShortDisplayName string
	Record           string
}

type Venue

type Venue struct {
	FullName string
	Address  VenueAddress
	Capacity int
	Indoor   bool
}

type VenueAddress

type VenueAddress struct {
	City  string
	State string
}

type Week

type Week struct {
	Name  string
	Start time.Time
	End   time.Time
}

Directories

Path Synopsis
clients

Jump to

Keyboard shortcuts

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