[#227] netmap: Refactor and document package functionality

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-06-07 11:25:34 +03:00 committed by LeL
parent 5bfdb64251
commit ca523f1ff1
51 changed files with 2460 additions and 3819 deletions

View file

@ -1,11 +1,42 @@
/*
Package netmap provides routines for working with netmap and placement policy.
Work is done in 4 steps:
1. Create context containing results shared between steps.
2. Processing filters.
3. Processing selectors.
4. Processing replicas.
Package netmap provides functionality for working with information about the
NeoFS network, primarily a layer of storage nodes.
The package concentrates all the characteristics of NeoFS networks.
NetMap represents NeoFS network map - one of the main technologies used to
store data in the system. It is composed of information about all storage nodes
(NodeInfo type) in a particular network. NetMap methods allow you to impose
container storage policies (PlacementPolicy type) on a fixed composition of
nodes for selecting nodes corresponding to the placement rules chosen by the
container creator.
NetworkInfo type is dedicated to descriptive characterization of network state
and settings.
Instances can be also used to process NeoFS API V2 protocol messages
(see neo.fs.v2.netmap package in https://github.com/nspcc-dev/neofs-api).
On client side:
import "github.com/nspcc-dev/neofs-api-go/v2/netmap"
var msg netmap.NodeInfo
msg.WriteToV2(&msg)
// send msg
On server side:
// recv msg
var info netmap.NodeInfo
err := info.ReadFromV2(msg)
// ...
// process dec
Using package types in an application is recommended to potentially work with
different protocol versions with which these types are compatible.
Each step depends only on previous ones.
*/
package netmap