server

package
v0.40.0 Latest Latest
Warning

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

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

Documentation

Overview

Package server is the SPECTRE server, which collects the quarantines that mirrors report. It keeps them in a storage backend, in memory or in Redis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, config ServeConfig) error

Serve runs a SPECTRE server until ctx is cancelled. Mesh mTLS secures it, so it serves plaintext HTTP/1 and unencrypted HTTP/2.

Types

type ClearConfig

type ClearConfig struct {
	Client      client.Config `embed:""`
	Service     string        `required:"" help:"Service whose divergences to clear."`
	Environment string        `required:"" help:"Environment whose divergences to clear."`
}

ClearConfig names the service environment whose divergences to clear.

type ServeConfig

type ServeConfig struct {
	Listen  string         `default:"127.0.0.1:50070" help:"Address for the SPECTRE server: host:port, or unix:<path|@abstract>."`
	Storage storage.Config `embed:""`
}

ServeConfig configures the SPECTRE server.

type Service

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

Service serves the SPECTRE service API.

func NewService

func NewService(store storage.Store) *Service

NewService returns a SPECTRE server that keeps divergences in store.

func (*Service) ClearDivergences

ClearDivergences removes the divergences of one service environment.

func (*Service) Handler

func (s *Service) Handler() http.Handler

Handler serves the API.

func (*Service) ListDivergences

ListDivergences returns the latest quarantine of each mirror direction.

func (*Service) Quarantine

Quarantine records that a mirror quarantined its candidate.

Directories

Path Synopsis
Package client calls the SPECTRE server.
Package client calls the SPECTRE server.
Package reporter reports a mirror's quarantines to the SPECTRE server.
Package reporter reports a mirror's quarantines to the SPECTRE server.
Package storage keeps the divergences that mirrors report to the SPECTRE server, either in memory or in Redis.
Package storage keeps the divergences that mirrors report to the SPECTRE server, either in memory or in Redis.
Package wire converts between the SPECTRE service protocol and the domain model, so only the server's API boundary handles protocol messages.
Package wire converts between the SPECTRE service protocol and the domain model, so only the server's API boundary handles protocol messages.

Jump to

Keyboard shortcuts

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