misc

package
v0.0.55 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

README

routes/misc

HTTP route handlers that don't fit in other categories. Provides a catch-all 404 handler that returns the unmatched path and HTTP method as JSON, a config endpoint that serializes and returns the full parsed API configuration including boxes, services, userlists with credentials, and HTTP settings, and a set of handlers for pausing and resuming the competition and reporting its current pause status.

The pause and unpause handlers toggle the global pause state owned by the services package, which stops checks from being handed out to agents for the duration — intended for planned interruptions such as a lunch break. Both are idempotent in effect but not silent about it: attempting to pause while already paused, or unpause while already running, aborts with 418 I'm a Teapot and a message saying so, leaving the state untouched. A successful toggle returns 200 with a confirmation message. A third, read-only handler reports whether the competition is currently paused along with the moment it entered that state, read as a single consistent snapshot.

Documentation

Overview

Package misc contains routes that don't belong in other categories. This includes error routes and API config routes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(c *gin.Context)

GetConfig is a route that returns the api configuration file. This can be useful for frontends to determine the list of valid boxes, services, and user lists.

@Summary		Get API configuration
@Description	Returns the loaded API config, including box definitions, user lists, and team count. Useful for building dynamic PCR forms.
@Tags			misc
@Produce		json
@Success		200	{object}	config.APIConfigSpec
@Router			/config [get]

func NoRoute

func NoRoute(router *gin.Engine) func(c *gin.Context)

NoRoute responds with a 404 when no other route is matched. Provides the user a list of "similar" endpoints available. This is helpful while manually testing. To be fully accurate, this needs to be the last route registered on the server.

func Pause

func Pause(c *gin.Context)

Pause handles quincy pause. This for things like lunch during a competition.

@Summary		Pause the competition
@Description	Halts scoring for planned interruptions such as a lunch break. While paused, agents requesting a check receive a no-op assignment instead, so no checks run and no scores are recorded. Returns 418 if the competition is already paused. The pause state is held in memory: an API server restart discards it and falls back to the start_paused setting in the config.
@Tags			misc
@Produce		json
@Success		200	{object}	object
@Failure		418	{object}	object
@Router			/pause [post]

func PauseStatus added in v0.0.55

func PauseStatus(c *gin.Context)

PauseStatus handles reporting whether quincy is currently paused.

@Summary		Get the competition pause status
@Description	Reports whether the competition is currently paused and when it entered that state. Returns an object with two fields: `is_paused` (bool) and `since` (RFC 3339 timestamp). The timestamp is the moment of the last pause or unpause, or the time the API server started if the state has not changed since boot.
@Tags			misc
@Produce		json
@Success		200	{object}	object
@Router			/pause-status [get]

func Unpause

func Unpause(c *gin.Context)

Unpause handles quincy unpause. This for things like lunch during a competition.

@Summary		Resume the competition
@Description	Resumes scoring after a pause. Agents begin receiving real checks again from wherever the queue left off. Returns 418 if the competition is not currently paused.
@Tags			misc
@Produce		json
@Success		200	{object}	object
@Failure		418	{object}	object
@Router			/unpause [post]

Types

This section is empty.

Jump to

Keyboard shortcuts

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