netmap

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket = netmap.Bucket

Bucket represents NeoFS network map as a graph.

If is a type alias of github.com/nspcc-dev/netmap.Bucket.

type Info

type Info = node.Info

Info represent node information.

It is a type alias of github.com/nspcc-dev/neofs-node/pkg/core/netmap/node.Info.

type NetMap

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

NetMap represents NeoFS network map with concurrent access support.

func New

func New() *NetMap

New creates and initializes a new NetMap.

Using the NetMap that has been created with new(NetMap) expression (or just declaring a NetMap variable) is unsafe and can lead to panic.

func (*NetMap) AddNode

func (n *NetMap) AddNode(nodeInfo Info) error

AddNode adds node information to the network map

If node with provided information is already presented in network map, nothing happens,

func (NetMap) Nodes

func (n NetMap) Nodes() []Info

Nodes returns node list of the network map.

Changing the result is unsafe and affects the network map.

func (NetMap) Root

func (n NetMap) Root() *Bucket

Root returns the root bucket of the network map.

Changing the result is unsafe and affects the network map.

func (*NetMap) SetNodes

func (n *NetMap) SetNodes(v []Info)

SetNodes sets node list of the network map.

Subsequent changing the source slice is unsafe and affects the network map.

func (*NetMap) SetRoot

func (n *NetMap) SetRoot(v *Bucket)

SetRoot sets the root bucket of the network map.

Subsequent changing the source bucket is unsafe and affects the network map.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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