api

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package api implements the API used by the UI: edges, targets, results, traceroutes, data lifecycle, accounts and alerting.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allowed

func Allowed(role store.Role, procedure string) bool

Allowed is the role policy of AdminService and AlertService.

func ExportHandler

func ExportHandler(st *store.Store, authSvc interface {
	Authenticate(ctx context.Context, h http.Header) (auth.Principal, error)
}) http.Handler

ExportHandler serves GET /export/{checks,traces}.csv?from=&to=[&edge_id=][&target_id=] to any signed in user. Times are RFC 3339.

func HealthHandler

func HealthHandler(st *store.Store) http.Handler

HealthHandler answers 200 when the database answers, 503 otherwise. No session needed: it says nothing but "ok".

Types

type Admin

type Admin struct {
	Store     *store.Store
	CA        *pki.CA
	Hub       *fleet.Hub
	Assigner  *fleet.Assigner
	PublicURL string // gateway URL as edges reach it, for the enroll command
}

Admin serves AdminService (operators only).

func (*Admin) MetricsHandler

func (a *Admin) MetricsHandler(token, version string) http.Handler

MetricsHandler serves the current state in the Prometheus text format, to scrapers presenting "Authorization: Bearer <token>". Without a token the endpoint does not exist.

type AlertAdmin

type AlertAdmin struct {
	Store  *store.Store
	Sender *alerting.Sender
}

AlertAdmin implements AlertService.

Jump to

Keyboard shortcuts

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