reporter

package
v0.45.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package reporter reports a mirror's quarantines to the SPECTRE server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Client      client.Config `embed:""`
	Service     string        `required:"" help:"Service the mirror runs, reported to the SPECTRE server."`
	Environment string        `required:"" help:"Environment the mirror runs in, such as production-us-west-2, reported to the SPECTRE server."`
	Revision    string        `required:"" help:"Commit of the candidate the mirror runs, reported to the SPECTRE server."`
}

Config configures how a mirror reports quarantines to the SPECTRE server.

type Reporter

type Reporter struct {
	// contains filtered or unexported fields
}

Reporter sends each quarantine of a mirror's sources to the SPECTRE server.

func New

func New(config Config, server *client.Client, sources ...Source) *Reporter

New reports the quarantines of a mirror's sources through server.

func (*Reporter) Run

func (r *Reporter) Run(ctx context.Context)

Run reports each source's quarantine until ctx is cancelled. A quarantine not yet reported when ctx is cancelled is lost.

type Source

type Source struct {
	Direction model.Direction
	// Quarantined receives the proxy's quarantine once, when it begins.
	Quarantined <-chan model.Quarantine
}

Source is a proxy whose quarantine a mirror reports.

Jump to

Keyboard shortcuts

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