scoring

package
v0.0.57 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

README

routes/scoring

HTTP route handlers for the scoring display endpoints, intended for frontends and operators. Provides six endpoints: current service status showing the most recent check result for every team and service combination; scores aggregated per team; scores aggregated per box; scores aggregated per box and service; a full per-team per-box per-service breakdown; and a per-team history endpoint returning the most recent raw check results for each of that team's services.

The history endpoint is the only one here that takes parameters: the team number comes from the path and is validated against the configured team count, and an optional query parameter sets how many checks to return per service, defaulting to ten and capped to bound the size of a single response.

Agent-facing endpoints (fetching the next check and submitting a completed result) live in the sibling routes/agent package, not here.

Documentation

Overview

Package scoring contains all the routes involving scorechecks. This includes agent routes to get new checks and post completed ones, as well as frontend routes to get final scores or the current status.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBoxScores

func GetBoxScores(c *gin.Context)

GetBoxScores returns the final stats per box.

@Summary		Get cumulative scores per box
@Description	Returns pass/fail check stats aggregated across all teams and services, keyed by box name.
@Tags			scores
@Produce		json
@Success		200	{object}	map[string]types.ScoreResult
@Failure		400	{object}	object
@Failure		501	{object}	object
@Router			/scores/box [get]

func GetDetailedScores

func GetDetailedScores(c *gin.Context)

GetDetailedScores returns the final stats per team per box per service. This is as detailed as final scores can be.

@Summary		Get fully detailed scores
@Description	Returns pass/fail stats keyed by team, then box, then service. Shape: {"team": {"box": {"service": ScoreResult}}}.
@Tags			scores
@Produce		json
@Success		200	{object}	map[string]map[string]map[string]types.ScoreResult
@Failure		400	{object}	object
@Failure		501	{object}	object
@Router			/scores/detailed [get]

func GetRecentChecks

func GetRecentChecks(c *gin.Context)

GetRecentChecks gets a list of the the most recent checks for every service. It is sorted by team number, then box ID, then service ID

@Summary		Get most recent check result per service per team
@Description	Returns the latest pass/fail score for every (team, box, service) combination. Sorted by team, box, service.
@Tags			scores
@Produce		json
@Success		200	{array}		types.Score
@Failure		400	{object}	object
@Failure		501	{object}	object
@Router			/scores/current [get]

func GetRecentNChecks added in v0.0.57

func GetRecentNChecks(c *gin.Context)

GetRecentNChecks returns the N most recent checks for every service of one team.

@Summary		Get the N most recent checks for a team
@Description	Returns the most recent checks for every service on every box of a single team. Sorted by box, then service, then newest check first.
@Tags			scores
@Produce		json
@Param			team	path		int	true	"Team number"
@Param			n		query		int	false	"Checks to return per service (default 10, max 100)"
@Success		200		{array}		types.Score
@Failure		400		{object}	object
@Failure		501		{object}	object
@Router			/scores/recent/{team} [get]

func GetServiceScores

func GetServiceScores(c *gin.Context)

GetServiceScores returns the final stats per box per service.

@Summary		Get cumulative scores per box per service
@Description	Returns pass/fail check stats keyed by box name, then service name. Shape: {"box": {"service": ScoreResult}}.
@Tags			scores
@Produce		json
@Success		200	{object}	map[string]map[string]types.ScoreResult
@Failure		400	{object}	object
@Failure		501	{object}	object
@Router			/scores/service [get]

func GetTeamScores

func GetTeamScores(c *gin.Context)

GetTeamScores returns the final stats per team.

@Summary		Get cumulative scores per team
@Description	Returns pass/fail check stats aggregated across all boxes and services, keyed by team number.
@Tags			scores
@Produce		json
@Success		200	{object}	map[string]types.ScoreResult
@Failure		400	{object}	object
@Failure		501	{object}	object
@Router			/scores/team [get]

Types

This section is empty.

Jump to

Keyboard shortcuts

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