Help us shape the future of Go! Take the 2026 Go Developer Survey

api

package
v1.3.103 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package api pkg/deployment/rf/api/api.go c2-net-routing

Package api pkg/deployment/rf/api/charts.go

Package api pkg/deployment/rf/api/stats.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// Stats, when set, adds the process and traffic charts to the status page.
	Stats *charts.ServiceStats

	http.Handler

	DmsgServers []string
	// contains filtered or unexported fields
}

API represents the api of the route-finder service.

func New

func New(s store.Store, logger logrus.FieldLogger, enableMetrics bool, dmsgAddr string) *API

New creates a new api

func (*API) Charts added in v1.3.101

func (a *API) Charts() *charts.Page

Charts is the charts page, or nil until StartCharts runs.

func (*API) ChartsPage added in v1.3.100

func (a *API) ChartsPage(w http.ResponseWriter, r *http.Request)

ChartsPage serves the charts page, or 404 when charts are not running.

func (*API) ShareTransportsFrom added in v1.3.99

func (a *API) ShareTransportsFrom(url string)

ShareTransportsFrom builds the route graph from the live transport set of a TPD in this process writing to the redis at url, when there is one (see GraphCache.ShareFrom). Call before StartGraphCache.

func (*API) StartCharts added in v1.3.100

func (a *API) StartCharts(ctx context.Context, st charts.Store, sn *SetupNodes, log logrus.FieldLogger)

StartCharts samples the finder's counts, and those of sn when it is set, into st until ctx ends and serves them as the charts page.

func (*API) StartGraphCache

func (a *API) StartGraphCache(ctx context.Context)

StartGraphCache builds one shared full-network graph, which route requests then rebuild when they find it stale, so they no longer each build a per-source graph by walking the store. Bound to ctx (the server lifecycle); until the first build lands, requests fall back to the per-source build. Call once at server start.

type HealthCheckResponse

type HealthCheckResponse = httputil.HealthCheckResponse

HealthCheckResponse is the /health body every service shares.

type SetupNodes added in v1.3.100

type SetupNodes struct {
	PKs    []cipher.PubKey
	Client *http.Client
	Port   uint16
}

SetupNodes are the route setup nodes whose public /stats the route finder charts, read over Client (an HTTP client that dials dmsg).

Jump to

Keyboard shortcuts

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