Documentation
¶
Index ¶
- type Server
- func (s *Server) Addr() net.Addr
- func (s *Server) Close() error
- func (s *Server) ListenAndServe(addr string) error
- func (s *Server) LocalNodeCount() int
- func (s *Server) PeerNodeCount() int
- func (s *Server) Ready() <-chan struct{}
- func (s *Server) SendPunchCommand(nodeID uint32, targetIP net.IP, targetPort uint16) error
- func (s *Server) ServeHealth(addr string) error
- func (s *Server) SetHealthy(ok bool)
- func (s *Server) SetRegistry(addr string)
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 NewWithPeers ¶
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) ListenAndServe ¶
func (*Server) LocalNodeCount ¶
LocalNodeCount returns the number of locally registered nodes.
func (*Server) PeerNodeCount ¶
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 ¶
SendPunchCommand tells a node to send UDP to a target endpoint.
func (*Server) ServeHealth ¶
ServeHealth starts a simple HTTP server with a /healthz endpoint for load balancer health checks.
func (*Server) SetHealthy ¶
SetHealthy sets the health status (for graceful drain on scale-down).
func (*Server) SetRegistry ¶
SetRegistry sets the registry address for dynamic peer discovery. The beacon will periodically register itself and discover peers via the registry.