Documentation
¶
Overview ¶
Package status serves the SPECTRE status endpoint, reporting whether the candidate is quarantined and why, aggregated across the proxies.
Index ¶
Constants ¶
View Source
const Path = "/spectre/v1/status"
Path is the HTTP path that serves the SPECTRE status report.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves the aggregated SPECTRE status at Path as JSON.
func NewHandler ¶
NewHandler serves the quarantine state of sources at Path. Quarantine lasts for the process, so a healthy candidate has been healthy since started.
type Report ¶
type Report struct {
// Quarantined is true when any source has quarantined the candidate.
Quarantined bool `json:"quarantined"`
// HealthyForSeconds is how long the candidate has been healthy, measured on
// the mirror's clock. It is null while quarantined.
HealthyForSeconds Option[int64] `json:"healthy_for_seconds"`
// Sources is the per-source quarantine state.
Sources []SourceStatus `json:"sources"`
}
Report is the JSON body served at Path.
type Reporter ¶
type Reporter interface {
QuarantineStatus() proxy.QuarantineStatus
}
Reporter reports one source's candidate quarantine state.
type SourceStatus ¶
type SourceStatus struct {
Name string `json:"name"`
Quarantined bool `json:"quarantined"`
Reason string `json:"reason,omitempty"`
// Since is when quarantine began, as RFC 3339, empty while healthy.
Since string `json:"since,omitempty"`
}
SourceStatus is one source's quarantine state in a Report.
Click to show internal directories.
Click to hide internal directories.