client

package
v0.42.9 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWrongPublicKey = errors.New("public key is different from the key in the network map")

ErrWrongPublicKey is returned when the client's response is signed with a key different from the one declared in the network map.

Functions

func AssertKeyResponseCallback

func AssertKeyResponseCallback(expectedKey []byte) func(client.ResponseMetaInfo) error

AssertKeyResponseCallback returns client response callback which checks if the response was signed by the expected key. Returns ErrWrongPublicKey in case of key mismatch.

func NodeInfoFromNetmapElement

func NodeInfoFromNetmapElement(dst *NodeInfo, info interface {
	PublicKey() []byte
	Addresses() network.AddressGroup
	ExternalAddresses() network.AddressGroup
},
)

NodeInfoFromNetmapElement fills NodeInfo structure from the interface of the parsed netmap member's descriptor.

Args must not be nil.

func NodeInfoFromRawNetmapElement

func NodeInfoFromRawNetmapElement(dst *NodeInfo, info interface {
	PublicKey() []byte
	IterateAddresses(func(string) bool)
	NumberOfAddresses() int
	ExternalAddresses() []string
},
) error

NodeInfoFromRawNetmapElement fills NodeInfo structure from the interface of raw netmap member's descriptor.

Args must not be nil.

Types

type MultiAddressClient

type MultiAddressClient interface {
	Client

	// RawForAddress must return rawclient.Client
	// for the passed network.Address.
	RawForAddress(context.Context, network.Address, func(cli *rawclient.Client) error) error

	ReportError(error)
}

MultiAddressClient is an interface of the Client that supports multihost work.

type NodeInfo

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

NodeInfo groups information about a FrostFS storage node needed for Client construction.

func (NodeInfo) AddressGroup

func (x NodeInfo) AddressGroup() network.AddressGroup

AddressGroup returns a group of network addresses.

func (NodeInfo) ExternalAddressGroup

func (x NodeInfo) ExternalAddressGroup() network.AddressGroup

ExternalAddressGroup returns a group of network addresses.

func (*NodeInfo) PublicKey

func (x *NodeInfo) PublicKey() []byte

PublicKey returns a public key in a binary format.

Result must not be mutated.

func (*NodeInfo) SetAddressGroup

func (x *NodeInfo) SetAddressGroup(v network.AddressGroup)

SetAddressGroup sets a group of network addresses.

func (*NodeInfo) SetExternalAddressGroup

func (x *NodeInfo) SetExternalAddressGroup(v network.AddressGroup)

SetExternalAddressGroup sets an external group of network addresses.

func (*NodeInfo) SetPublicKey

func (x *NodeInfo) SetPublicKey(v []byte)

SetPublicKey sets a public key in a binary format.

Argument must not be mutated.

Jump to

Keyboard shortcuts

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