netmap

package
v0.46.14 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLatestNetworkMap

func GetLatestNetworkMap(ctx context.Context, src Source) (*netmap.NetMap, error)

GetLatestNetworkMap requests and returns the latest network map from the storage.

func GetPreviousNetworkMap

func GetPreviousNetworkMap(ctx context.Context, src Source) (*netmap.NetMap, error)

GetPreviousNetworkMap requests and returns previous from the latest network map from the storage.

Types

type AnnouncedKeys

type AnnouncedKeys interface {
	// IsLocalKey checks if the key was announced by a local node.
	IsLocalKey(key []byte) bool
}

AnnouncedKeys is an interface of utility for working with the announced public keys of the storage nodes.

type ConfigSource added in v0.45.0

type ConfigSource interface {
	// NetmapNodesAssumedTrusted returns network parameter which indicates if
	// netmap nodes are assumed trusted senders.
	NetmapNodesAssumedTrusted(context.Context) bool
}

ConfigSource interface provides methods to read FrostFS network parameters.

type Node

type Node netmap.NodeInfo

Node is a named type of netmap.NodeInfo which provides interface needed in the current repository. Node is expected to be used everywhere instead of direct usage of netmap.NodeInfo, so it represents a type mediator.

func (Node) Addresses added in v0.45.0

func (x Node) Addresses() iter.Seq[string]

Addresses returns an iterator over all announced network addresses.

func (Node) ExternalAddresses

func (x Node) ExternalAddresses() []string

ExternalAddresses returns external addresses of a node.

func (Node) IterateAddresses

func (x Node) IterateAddresses(f func(string) bool)

IterateAddresses iterates over all announced network addresses and passes them into f. Handler MUST NOT be nil. Deprecated: use Node.Addresses instead.

func (Node) NumberOfAddresses

func (x Node) NumberOfAddresses() int

NumberOfAddresses returns number of announced network addresses.

func (Node) PublicKey

func (x Node) PublicKey() []byte

PublicKey returns public key bound to the storage node.

Return value MUST NOT be mutated, make a copy first.

type Nodes

type Nodes []netmap.NodeInfo

Nodes is a named type of []netmap.NodeInfo which provides interface needed in the current repository. Nodes is expected to be used everywhere instead of direct usage of []netmap.NodeInfo, so it represents a type mediator.

type Source

type Source interface {
	// GetNetMap reads the diff-th past network map from the storage.
	// Calling with zero diff returns the latest network map.
	// It returns the pointer to the requested network map and any error encountered.
	//
	// GetNetMap must return exactly one non-nil value.
	// GetNetMap must return ErrNotFound if the network map is not in the storage.
	//
	// Implementations must not retain the network map pointer and modify
	// the network map through it.
	GetNetMap(ctx context.Context, diff uint64) (*netmap.NetMap, error)

	// GetNetMapByEpoch reads network map by the epoch number from the storage.
	// It returns the pointer to the requested network map and any error encountered.
	//
	// Must return exactly one non-nil value.
	//
	// Implementations must not retain the network map pointer and modify
	// the network map through it.
	GetNetMapByEpoch(ctx context.Context, epoch uint64) (*netmap.NetMap, error)

	// Epoch reads the current epoch from the storage.
	// It returns thw number of the current epoch and any error encountered.
	//
	// Must return exactly one non-default value.
	Epoch(ctx context.Context) (uint64, error)
}

Source is an interface that wraps basic network map receiving method.

type State

type State interface {
	// CurrentEpoch returns the number of the current FrostFS epoch.
	CurrentEpoch() uint64
}

State groups the current system state parameters.

Jump to

Keyboard shortcuts

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