Documentation
¶
Overview ¶
Package registry provides node information caching and retrieval
Index ¶
Constants ¶
View Source
const ( // ErrInvalidNetwork is returned when an invalid node ID is provided ErrInvalidNetwork = "invalid node network" // ErrNetworkExists is returned when an network is provided that already exists ErrNetworkExists = "network already exists" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeRegistry ¶
type NodeRegistry struct {
// contains filtered or unexported fields
}
NodeRegistry manages data on active nodes
func New ¶
func New(logger *zap.SugaredLogger, ports config.Ports, nodes ...*ipfs.NodeInfo) *NodeRegistry
New sets up a new registry with provided nodes
func (*NodeRegistry) Deregister ¶
func (r *NodeRegistry) Deregister(network string) error
Deregister removes node with given network
func (*NodeRegistry) Get ¶
func (r *NodeRegistry) Get(network string) (ipfs.NodeInfo, error)
Get retrieves details about node with given network
func (*NodeRegistry) List ¶
func (r *NodeRegistry) List() []ipfs.NodeInfo
List retrieves a list of all known nodes
Click to show internal directories.
Click to hide internal directories.