Documentation ¶
Index ¶
- Variables
- func AssertKeyResponseCallback(expectedKey []byte) func(client.ResponseMetaInfo) error
- func NodeInfoFromNetmapElement(dst *NodeInfo, info interface{ ... })
- func NodeInfoFromRawNetmapElement(dst *NodeInfo, info interface{ ... }) error
- type Client
- type MultiAddressClient
- type NodeInfo
- func (x NodeInfo) AddressGroup() network.AddressGroup
- func (x NodeInfo) ExternalAddressGroup() network.AddressGroup
- func (x *NodeInfo) PublicKey() []byte
- func (x *NodeInfo) SetAddressGroup(v network.AddressGroup)
- func (x *NodeInfo) SetExternalAddressGroup(v network.AddressGroup)
- func (x *NodeInfo) SetPublicKey(v []byte)
Constants ¶
This section is empty.
Variables ¶
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 Client ¶
type Client interface { ObjectPutInit(context.Context, client.PrmObjectPutInit) (client.ObjectWriter, error) ObjectPutSingle(context.Context, client.PrmObjectPutSingle) (*client.ResObjectPutSingle, error) ObjectDelete(context.Context, client.PrmObjectDelete) (*client.ResObjectDelete, error) ObjectGetInit(context.Context, client.PrmObjectGet) (*client.ObjectReader, error) ObjectHead(context.Context, client.PrmObjectHead) (*client.ResObjectHead, error) ObjectSearchInit(context.Context, client.PrmObjectSearch) (*client.ObjectListReader, error) ObjectRangeInit(context.Context, client.PrmObjectRange) (*client.ObjectRangeReader, error) ObjectHash(context.Context, client.PrmObjectHash) (*client.ResObjectHash, error) ExecRaw(f func(client *rawclient.Client) error) error Close() error }
Client is an interface of FrostFS storage node's client.
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 ¶
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 ¶
SetPublicKey sets a public key in a binary format.
Argument must not be mutated.