Documentation
¶
Overview ¶
Package types contains global definitions that are shared between the agent and API. Has no dependencies and is easily importable for any Golang frontend.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckName ¶
type CheckName string
CheckName is the identifier of a check. This has no uniqueness constraint. It has no meaning to the API; is only used by the agent.
type PauseRecord ¶ added in v0.0.56
type PauseRecord struct {
ScoringState PauseState `json:"scoring_is_paused" example:"false"`
ScoringSince time.Time `json:"scoring_since" example:"2026-09-25T14:02:11.482913Z"`
CheckState PauseState `json:"checks_are_paused" example:"true"`
CheckSince time.Time `json:"checks_since" example:"2026-09-25T14:37:50.119204Z"`
}
PauseRecord is the state of the competitions pauses.
type PauseState ¶ added in v0.0.56
type PauseState bool
PauseState describes whether quincy should count scores during a period or not.
const ( // Paused is the state where no scores are counted. Paused PauseState = true // Unpause is the state where scores are counted. Unpaused PauseState = false // PauseDefault can be used in error cases as a safe failure incase the caller ignores errors. PauseDefault PauseState = Paused )
type PauseType ¶ added in v0.0.56
type PauseType string
Pause type defines the type of pause
const ( // ScoringPause is a type of pause where checks are still run, but scores are not counted // The scoreboard reflects the most recent checks, but final scores are not updated ScoringPause PauseType = "scoring" // CheckPause is a type of pause where the scoring agents do not run checks. CheckPause PauseType = "check" )
type Score ¶
type Score struct {
TeamNum TeamNum `json:"team_num" example:"1"`
Status bool `json:"status" example:"true"`
BoxName BoxName `json:"box" example:"scrapyard"`
ServiceName ServiceName `json:"service" example:"blog"`
Stdout string `json:"stdout" example:"HTTP 200 OK\nexit 0"`
Stderr string `json:"stderr" example:"something got past your bow :("`
// Timestamp is inserted by the api on submission.
// Does not need to added when building manually.
Timestamp int64 `json:"timestamp" example:"1700000000000000"`
}
Score is the results of a completed score check. It has a boolean pass/fail, and the stdout/stderr captured from the check.
type ScoreResult ¶
type ScoreResult struct {
ChecksPassed uint64 `json:"checks_passed" example:"42"`
ChecksFailed uint64 `json:"checks_failed" example:"8"`
TotalChecks uint64 `json:"total_checks" example:"50"`
UptimePercent float64 `json:"uptime_percent" example:"84.00"`
}
ScoreResult is a flexible object used to store information about scoring results. This can be used for an entire team, one specific service for one team, one box for every team, and more.
type Service ¶
type Service struct {
ServiceTemplate
User *User `json:"user,omitempty,omitzero"`
NoOp bool `json:"no_op,omitempty,omitzero" example:"false"`
}
Service is a fully rendered service ready to be run by the agent. Is just a ServiceTemplate with an added user and a potential no-op order.
type ServiceName ¶
type ServiceName string
ServiceName is the identifier of a service. This is unique under a single box, but different boxes can have services with the same ID.
type ServiceSpec ¶
type ServiceSpec struct {
Name ServiceName `yaml:"name" mapstructure:"name" json:"name" example:"blog"`
CheckName CheckName `yaml:"check" mapstructure:"check" json:"check" example:"100percent.py"`
UserList UserListName `yaml:"user_list" mapstructure:"user_list" json:"user_list,omitempty" example:"local users"`
Timeout float64 `yaml:"timeout" mapstructure:"timeout" json:"timeout,omitempty" example:"30"`
}
ServiceSpec contains the config specification of one service. This always belongs to a box, but the object is not linked directly. Service Names are only unique per individual box.
type ServiceTemplate ¶
type ServiceTemplate struct {
ServiceSpec
BoxName BoxName `json:"box" example:"scrapyard"`
Host string `json:"host" example:"127.0.0.1"`
TeamNum TeamNum `json:"team_num" example:"1"`
}
ServiceTemplate contains *almost* everything an agent needs to run a check. It adds variables from the box, and a specific team number. It is only missing a user, as this needs to be pulled from the db on demand.
type TeamNum ¶
type TeamNum uint32
TeamNum is the identifier of a team. They start from 1 and go up to the configure number of teams [1, num_teams].
type User ¶
type User struct {
Username string `json:"username" example:"geraldo"`
Password string `json:"password" example:"BuyMyNFT1!"`
DomainName string `json:"domain,omitempty,omitzero" example:"quin.cy"`
NetBIOSName string `json:"netbios,omitempty,omitzero" example:"QUIN"`
}
User contains all the information relating to a single user.