Nexus: Index | Files

package registry

import ""

Package registry provides node information caching and retrieval


Package Files

doc.go registry.go


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"

type NodeRegistry Uses

type NodeRegistry struct {
    // contains filtered or unexported fields

NodeRegistry manages data on active nodes

func New Uses

func New(logger *zap.SugaredLogger, ports config.Ports, nodes ...*ipfs.NodeInfo) *NodeRegistry

New sets up a new registry with provided nodes

func (*NodeRegistry) Close Uses

func (r *NodeRegistry) Close()

Close stops registry background jobs

func (*NodeRegistry) Deregister Uses

func (r *NodeRegistry) Deregister(network string) error

Deregister removes node with given network

func (*NodeRegistry) Get Uses

func (r *NodeRegistry) Get(network string) (ipfs.NodeInfo, error)

Get retrieves details about node with given network

func (*NodeRegistry) List Uses

func (r *NodeRegistry) List() []ipfs.NodeInfo

List retrieves a list of all known nodes

func (*NodeRegistry) Register Uses

func (r *NodeRegistry) Register(node *ipfs.NodeInfo) error

Register registers a node and allocates appropriate ports

Package registry imports 7 packages (graph) and is imported by 4 packages. Updated 2019-01-18. Refresh now. Tools for package owners.