api

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

api

The central API server. It loads competition configuration from a YAML file, initializes any configured data sinks, builds a shuffled service check queue, and serves a JSON REST API over HTTP using Gin. Startup order is fixed — config must load before sinks can initialize, and sinks must be ready before services can be queued — so any failure in an earlier step halts startup entirely.

PostgreSQL is an optional sink. When configured it stores scores, credentials, and historical data; when omitted the server still serves check assignments and accepts score submissions, but routes that require persistent storage respond with 501 Not Implemented.

The binary also supports a subcommand to generate a default config file on disk. The default config is embedded in the binary at build time, so the binary is self-contained and can bootstrap a new setup without any external files.

The OpenAPI spec is auto-generated from source annotations and served interactively at /swagger/ when the server is running. The raw spec files live in src/api/openapi/.

Documentation

Overview

Quincy is a CCDC-style competition scoring engine. It consists of two components: this API server, which manages scoring data, configuration, and user credentials; and a distributed check agent that polls the API for work, runs service checks, and posts results back.

@title Quincy API @version 1.0 @description CCDC-style competition scoring engine. Manages scoring data and serves check assignments to agents.

@BasePath /api/v1

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpConfig

func DumpConfig(forceOverwrite bool, printInstead bool)

DumpConfig writes the default YAML config to disk, or prints it to stdout.

func Start

func Start(cfg *config.APIConfigSpec) error

Start is the entry point for the API server. It validates the config, initializes all subsystems, and serves HTTP.

Types

This section is empty.

Directories

Path Synopsis
Package config handles the delivery of the config to the rest of the API.
Package config handles the delivery of the config to the rest of the API.
Package openapi Code generated by swaggo/swag.
Package openapi Code generated by swaggo/swag.
Package routes contains all of the Gin HTTP API logic.
Package routes contains all of the Gin HTTP API logic.
graphs
Package graphs contains routes that generate html/js graphs that can be embedded into other pages.
Package graphs contains routes that generate html/js graphs that can be embedded into other pages.
misc
Package misc contains routes that don't belong in other categories.
Package misc contains routes that don't belong in other categories.
scoring
Package scoring contains all the routes involving scorechecks.
Package scoring contains all the routes involving scorechecks.
users
Package users contains all the API routes involving scoring users.
Package users contains all the API routes involving scoring users.
Package services contains the logic for templating and serving checks to agents.
Package services contains the logic for templating and serving checks to agents.
postgres
Package postgres contains all PostgreSQL databse connection logic and queries.
Package postgres contains all PostgreSQL databse connection logic and queries.
postgres/conn
Package conn handles the initialization and distribution of the database connection object.
Package conn handles the initialization and distribution of the database connection object.
postgres/graphs
Package graphs contains database functions for generating visualizations.
Package graphs contains database functions for generating visualizations.
postgres/users
Package users contains the DB functions and all SQL queries involving scoring users.
Package users contains the DB functions and all SQL queries involving scoring users.

Jump to

Keyboard shortcuts

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