central

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package central is the server: edge API, web API, storage and alerting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoctorSteps added in v1.1.0

func DoctorSteps(cfg DoctorConfig) ([]doctor.Step, func())

DoctorSteps checks, in order, what the central needs: the database, the TimescaleDB extension, the schema, the edges and checks, whether the edges report, and how the edge API is exposed. The returned function releases what the steps opened.

Types

type DoctorConfig added in v1.1.0

type DoctorConfig struct {
	DatabaseURL string
	EdgeListen  string
	APIListen   string
	// EdgeTLSCert and APITLSCert are the certificate files the surfaces serve,
	// when they serve TLS themselves.
	EdgeTLSCert string
	APITLSCert  string
	// SecretKeyFile is the file of the key that encrypts the channels, if any.
	SecretKeyFile string
	// Now is the clock; nil means time.Now.
	Now func() time.Time
}

DoctorConfig is what the central diagnostics need.

type Option added in v1.1.0

type Option func(*Server)

Option changes how the edge API is built.

func WithProxies added in v1.1.0

func WithProxies(p auth.Proxies) Option

WithProxies names the reverse proxies trusted to say who the client is.

type Server added in v1.1.0

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

Server is the edge API. Edges authenticate with the token the store issued them; checks and results live in the store.

func New added in v1.1.0

func New(log *slog.Logger, st *store.Store, opts ...Option) *Server

New builds the edge API on top of a store.

func (*Server) Handler added in v1.1.0

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

Handler serves the edge API.

Directories

Path Synopsis
Package alert opens an incident when a check keeps failing or an edge goes quiet, resolves it when it stops, and tells the channels of each event.
Package alert opens an incident when a check keeps failing or an edge goes quiet, resolves it when it stops, and tells the channels of each event.
Package auth hashes passwords, enforces their policy and throttles login attempts.
Package auth hashes passwords, enforces their policy and throttles login attempts.
Package store keeps edges, checks and results in PostgreSQL with TimescaleDB.
Package store keeps edges, checks and results in PostgreSQL with TimescaleDB.
storetest
Package storetest gives tests a throwaway database; tests skip without NETPROBE_TEST_DATABASE_URL.
Package storetest gives tests a throwaway database; tests skip without NETPROBE_TEST_DATABASE_URL.
Package webapi is the JSON API the web UI talks to: accounts, sessions and the data of the central.
Package webapi is the JSON API the web UI talks to: accounts, sessions and the data of the central.

Jump to

Keyboard shortcuts

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