status

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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

func NewHandler(sources ...Source) *Handler

NewHandler serves the aggregated quarantine state of sources at Path.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request)

ServeHTTP serves the status report at Path and 404s every other path.

type Report

type Report struct {
	// Quarantined is true when any source has quarantined the candidate.
	Quarantined bool `json:"quarantined"`
	// 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 Source

type Source struct {
	Name     string
	Reporter Reporter
}

Source names a quarantine Reporter, e.g. the ingress or egress proxy.

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.

Jump to

Keyboard shortcuts

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