netmap

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Separator separates key:value pairs in string representation of options.
	Separator = netmap.Separator

	// NodesBucket is the name for optionless bucket containing only nodes.
	NodesBucket = netmap.NodesBucket
)

Variables

View Source
var (
	// FilterIn returns filter, which checks if value is in specified list.
	FilterIn = netmap.FilterIn
	// FilterNotIn returns filter, which checks if value is not in specified list.
	FilterNotIn = netmap.FilterNotIn
	// FilterOR returns OR combination of filters.
	FilterOR = netmap.FilterOR
	// FilterAND returns AND combination of filters.
	FilterAND = netmap.FilterAND
	// FilterEQ returns filter, which checks if value is equal to v.
	FilterEQ = netmap.FilterEQ
	// FilterNE returns filter, which checks if value is not equal to v.
	FilterNE = netmap.FilterNE
	// FilterGT returns filter, which checks if value is greater than v.
	FilterGT = netmap.FilterGT
	// FilterGE returns filter, which checks if value is greater or equal than v.
	FilterGE = netmap.FilterGE
	// FilterLT returns filter, which checks if value is less than v.
	FilterLT = netmap.FilterLT
	// FilterLE returns filter, which checks if value is less or equal than v.
	FilterLE = netmap.FilterLE
)

Functions

This section is empty.

Types

type Bucket

type Bucket = netmap.Bucket

Bucket is an alias for github.com/nspcc-dev/netmap.Bucket

type Filter

type Filter = netmap.Filter

Filter is an alias for github.com/nspcc-dev/netmap.Filter

type GetParams

type GetParams struct {
}

GetParams is a group of parameters for network map receiving operation.

type GetResult

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

GetResult is a group of values returned by container receiving operation.

func (GetResult) NetMap

func (s GetResult) NetMap() *NetMap

NetMap is a network map getter.

func (*GetResult) SetNetMap

func (s *GetResult) SetNetMap(v *NetMap)

SetNetMap is a network map setter.

type NetMap

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

NetMap is a general network map structure for NeoFS

func NewNetmap

func NewNetmap() *NetMap

NewNetmap is an constructor.

func (*NetMap) Add

func (n *NetMap) Add(addr string, pk []byte, st bootstrap.NodeStatus, opts ...string) error

Add adds node with given address and given options.

func (*NetMap) AddNode

func (n *NetMap) AddNode(nodeInfo *bootstrap.NodeInfo, opts ...string) error

AddNode adds to exited or new node slice of given options.

func (*NetMap) Copy

func (n *NetMap) Copy() *NetMap

Copy creates and returns full copy of target netmap.

func (*NetMap) Equals

func (n *NetMap) Equals(nm *NetMap) bool

Equals return whether two netmap are identical.

func (*NetMap) FindGraph

func (n *NetMap) FindGraph(pivot []byte, ss ...SFGroup) (c *Bucket)

FindGraph finds sub-graph filtered by given SFGroup.

func (*NetMap) FindNodes

func (n *NetMap) FindNodes(pivot []byte, ss ...SFGroup) (nodes []uint32)

FindNodes finds sub-graph filtered by given SFGroup and returns all sub-graph items.

func (*NetMap) GetMaxSelection

func (n *NetMap) GetMaxSelection(ss []Select, fs []Filter) (r *Bucket)

GetMaxSelection returns 'maximal container' -- subgraph which contains any other subgraph satisfying specified selects and filters.

func (*NetMap) GetNodesByOption

func (n *NetMap) GetNodesByOption(opts ...string) []bootstrap.NodeInfo

GetNodesByOption returns slice of NodeInfo that has given option.

func (*NetMap) Hash

func (n *NetMap) Hash() (sum [32]byte)

Hash returns hash of n.

func (*NetMap) InheritWeights

func (n *NetMap) InheritWeights() *NetMap

InheritWeights calculates average capacity and minimal price, then provides buckets with IQR weight.

func (*NetMap) Items

func (n *NetMap) Items() []bootstrap.NodeInfo

Items return slice of all NodeInfo in netmap.

func (*NetMap) ItemsCopy

func (n *NetMap) ItemsCopy() Nodes

ItemsCopy return copied slice of all NodeInfo in netmap (is it useful?).

func (*NetMap) MarshalJSON

func (n *NetMap) MarshalJSON() ([]byte, error)

MarshalJSON custom marshaller.

func (*NetMap) Merge

func (n *NetMap) Merge(n1 *NetMap) error

Merge checks if merge is possible and then add new elements from given netmap.

func (*NetMap) Normalise

func (n *NetMap) Normalise() *NetMap

Normalise reorders netmap items into some canonical order.

func (*NetMap) Root

func (n *NetMap) Root() *Bucket

Root returns netmap root-bucket.

func (*NetMap) Size

func (n *NetMap) Size() int

Size returns number of nodes in network map.

func (*NetMap) UnmarshalJSON

func (n *NetMap) UnmarshalJSON(data []byte) error

UnmarshalJSON custom unmarshaller.

func (*NetMap) Update

func (n *NetMap) Update(nxt *NetMap)

Update replaces netmap with given netmap.

type Nodes

type Nodes []bootstrap.NodeInfo

Nodes is an alias for slice of NodeInfo which is structure that describes every host

func (Nodes) Copy

func (n Nodes) Copy() Nodes

Copy creates new slice of copied nodes.

type PlacementRule

type PlacementRule = netmap.PlacementRule

PlacementRule is an alias for github.com/nspcc-dev/netmap.Filter

type SFGroup

type SFGroup = netmap.SFGroup

SFGroup is an alias for github.com/nspcc-dev/netmap.SFGroup

type Select

type Select = netmap.Select

Select is an alias for github.com/nspcc-dev/netmap.Select

type SimpleFilter

type SimpleFilter = netmap.SimpleFilter

SimpleFilter is an alias for github.com/nspcc-dev/netmap.Filter

type Storage

type Storage interface {
	GetNetMap(GetParams) (*GetResult, error)
}

Storage is an interface of the storage of NeoFS network map.

Jump to

Keyboard shortcuts

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