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

serverfeed

package
v1.3.104 Latest Latest
Warning

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

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

Documentation

Overview

Package serverfeed reads the dmsg servers dmsg discovery publishes on its clients-by-server CXO feed, for the visor's server cache, the dmsg servers' peer discovery and TPD's marking of dmsg server visors.

Registered servers are leaves at clients-by-server/servers/<pk>, each the server's signed entry, version-framed and gzipped. Every server with at least one delegated client has a batch leaf at clients-by-server/<pk>; one of those with no registered entry is a server a hypervisor runs for its LAN.

Index

Constants

View Source
const (
	// Prefix is the clients-by-server feed's prefix.
	Prefix = "clients-by-server/"
	// ServerPrefix is where the registered servers' leaves are.
	ServerPrefix = Prefix + "servers/"
	// Version is the server leaf's frame version.
	Version = 1
)

Variables

This section is empty.

Functions

func Decode

func Decode(body []byte) *disc.Entry

Decode reads a server leaf, or returns nil when it is not one this build understands.

func Delegated

func Delegated(mgr *cxosub.Manager) map[string]struct{}

Delegated returns the keys, in hex, of every server that has at least one delegated client in mgr's snapshot.

func Encode

func Encode(e *disc.Entry) ([]byte, error)

Encode frames a server entry as a leaf body.

func LeafPath

func LeafPath(pk cipher.PubKey) string

LeafPath is a registered server's leaf.

func Servers

func Servers(mgr *cxosub.Manager) (servers []*disc.Entry, ok bool)

Servers returns the registered servers in mgr's snapshot of the feed. ok is false when there is no snapshot yet or it has no server leaves, as from a dmsg discovery older than the server leaves; the caller then asks over HTTP.

Types

This section is empty.

Jump to

Keyboard shortcuts

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