Documentation
¶
Index ¶
- func GetCurrentServiceStatus(ctx context.Context, db *pgxpool.Pool, cfg *config.APIConfigSpec) ([]types.Score, error)
- func GetRecentNScores(ctx context.Context, db *pgxpool.Pool, cfg *config.APIConfigSpec, ...) ([]types.Score, error)
- func InitScoring(ctx context.Context, db *pgxpool.Pool, cfg *config.APIConfigSpec) error
- type BoxScores
- type DetailedScores
- type ServiceScores
- type TeamScores
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentServiceStatus ¶
func GetCurrentServiceStatus(ctx context.Context, db *pgxpool.Pool, cfg *config.APIConfigSpec) ([]types.Score, error)
GetCurrentServiceStatus returns the entire recent scores table. It is sorted by team number, then box ID, then service ID.
func GetRecentNScores ¶ added in v0.0.57
func GetRecentNScores( ctx context.Context, db *pgxpool.Pool, cfg *config.APIConfigSpec, teamNum types.TeamNum, numChecks int, ) ([]types.Score, error)
GetRecentNScores collects the numChecks most recent scores for every service on every box belonging to a single team. Results are sorted by box, then service, then newest check first.
func InitScoring ¶
InitScoring creates rows in the final scores table for each team/box/service combo.
Types ¶
type BoxScores ¶
type BoxScores map[types.BoxName]types.ScoreResult
BoxScores is a map that can be used to quickly reference stats for a specific box.
type DetailedScores ¶
type DetailedScores map[types.TeamNum]ServiceScores
DetailedScores is a double-nested map that can be used to quickly reference stats for a specific teams' boxes' services. EXTREMELY ugly but i cant think of a better way to do this. this is a map[]map[]map[]. team_num -> box -> service.
func GetDetailedScores ¶
GetDetailedScores pulls the full final scoring data as it is stored in the db.
type ServiceScores ¶
type ServiceScores map[types.BoxName]map[types.ServiceName]types.ScoreResult
ServiceScores is a nested map that can be used to quickly reference stats for a specific boxes' specific service. very ugly but i cant think of a better way to do this.
func GetServiceScores ¶
GetServiceScores collates and calculates competion scores for each service on each box.
type TeamScores ¶
type TeamScores map[types.TeamNum]types.ScoreResult
TeamScores is a map that can be used to quickly reference a specific teams stats.
func GetTeamScores ¶
GetTeamScores collates and calculates competion scores for all teams.