Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GameScheduledUpdate ¶
type GameStatus ¶
type GameStatus string
const ( GameStatusCompleted GameStatus = "completed" GameStatusScheduled GameStatus = "scheduled" GameStatusStarted GameStatus = "started" )
type GameSummaryUpdate ¶
type GameSummaryUpdate struct { NBAGameID string NBAHomeTeamID int NBAAwayTeamID int HomeTeamPoints sql.NullInt64 AwayTeamPoints sql.NullInt64 GameStatusName string Attendance int SeasonStartYear string SeasonStageName string Period int PeriodTimeRemainingTenthSeconds int DurationSeconds sql.NullInt64 StartTime time.Time EndTime sql.NullTime }
type GameUpdate ¶
type GameUpdate struct { NBAGameID string NBAHomeTeamID int NBAAwayTeamID int HomeTeamPoints sql.NullInt64 AwayTeamPoints sql.NullInt64 GameStatusName string NBAArenaID int Attendance int SeasonStartYear int SeasonStageName string Sellout bool Period int PeriodTimeRemainingTenthSeconds int DurationSeconds int RegulationPeriods int StartTime time.Time EndTime sql.NullTime }
type Handler ¶
type Handler interface { Routes() chi.Router List(w http.ResponseWriter, r *http.Request) UpdateGames(w http.ResponseWriter, r *http.Request) }
type Service ¶
type Service interface { GetGameWithID(ctx context.Context, id string) (api.Game, error) List(ctx context.Context) ([]api.Game, error) GetGameWithNBAID(ctx context.Context, nbaID string) (api.Game, error) UpdateGame(ctx context.Context, logger *slog.Logger, gameID string, seasonStartYear int) (api.Game, error) UpdateSeasonGames(ctx context.Context, logger *slog.Logger, seasonStartYear int) ([]api.Game, error) }
func NewService ¶
func NewService( gameStore Store, arenaService arena.Service, gameRefereeService game_referee.Service, leagueService league.Service, playByPlayService playbyplay.Service, refereeService referee.Service, seasonService season.Service, teamService team.Service, teamGameStatsService team_game_stats.Service, nbaClient nba.Client, r2Client cloudflare.Client, ) Service
type Store ¶
type Store interface { List(ctx context.Context) ([]api.Game, error) GetGameWithID(ctx context.Context, id string) (api.Game, error) GetGamesWithIDs(ctx context.Context, ids []string) ([]api.Game, error) GetGameWithNBAID(ctx context.Context, id string) (api.Game, error) UpdateGamesSummary(ctx context.Context, gameUpdates []GameSummaryUpdate) ([]api.Game, error) UpdateGames(ctx context.Context, gameUpdates []GameUpdate) ([]api.Game, error) UpdateScheduledGames(ctx context.Context, gameUpdates []GameScheduledUpdate) ([]api.Game, error) }
Click to show internal directories.
Click to hide internal directories.