node

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	IP          string    `json:"ip"`
	Connected   time.Time `json:"connected_time"`
	ClientCount int       `json:"client_count"`
}

type Registry

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

func GlobalRegistry

func GlobalRegistry() *Registry

GlobalRegistry returns the shared node registry.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new registry.

func (*Registry) Add

func (r *Registry) Add(ip string, connectedAt time.Time)

Add adds the value.

func (*Registry) List

func (r *Registry) List() []Node

List returns the available entries.

func (*Registry) Remove

func (r *Registry) Remove(ip string)

Remove removes the value.

func (*Registry) TotalCount

func (r *Registry) TotalCount() int

TotalCount returns the current number of active client connections.

Jump to

Keyboard shortcuts

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