beacon

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

func New

func New() *Server

func NewWithPeers

func NewWithPeers(beaconID uint32, peers []string) *Server

NewWithPeers creates a beacon server with gossip peer support. beaconID uniquely identifies this beacon instance (0 = standalone). peers is a list of peer beacon addresses for gossip exchange.

func (*Server) Addr

func (s *Server) Addr() net.Addr

Addr returns the server's bound address. Only valid after Ready() fires.

func (*Server) Close

func (s *Server) Close() error

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string) error

func (*Server) LocalNodeCount

func (s *Server) LocalNodeCount() int

LocalNodeCount returns the number of locally registered nodes.

func (*Server) PeerNodeCount

func (s *Server) PeerNodeCount() int

PeerNodeCount returns the number of nodes known via gossip from peer beacons.

func (*Server) Ready

func (s *Server) Ready() <-chan struct{}

Ready returns a channel that is closed when the server has bound its port.

func (*Server) SendPunchCommand

func (s *Server) SendPunchCommand(nodeID uint32, targetIP net.IP, targetPort uint16) error

SendPunchCommand tells a node to send UDP to a target endpoint.

func (*Server) ServeHealth

func (s *Server) ServeHealth(addr string) error

ServeHealth starts a simple HTTP server with a /healthz endpoint for load balancer health checks.

func (*Server) SetHealthy

func (s *Server) SetHealthy(ok bool)

SetHealthy sets the health status (for graceful drain on scale-down).

func (*Server) SetRegistry

func (s *Server) SetRegistry(addr string)

SetRegistry sets the registry address for dynamic peer discovery. The beacon will periodically register itself and discover peers via the registry.

Jump to

Keyboard shortcuts

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