client

package
v0.49.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: GPL-3.0 Imports: 13 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 NodeInfoFromRawNetmapElement added in v0.26.0

func NodeInfoFromRawNetmapElement(dst *NodeInfo, info interface {
	PublicKey() []byte
	IterateAddresses(func(string) bool)
	NumberOfAddresses() int
}) 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(ctx context.Context, header object.Object, signer user.Signer, prm client.PrmObjectPutInit) (client.ObjectWriter, error)
	ReplicateObject(ctx context.Context, id oid.ID, src io.ReadSeeker, signer neofscrypto.Signer, signedReplication bool) (*neofscrypto.Signature, error)
	ObjectDelete(ctx context.Context, containerID cid.ID, objectID oid.ID, signer user.Signer, prm client.PrmObjectDelete) (oid.ID, error)
	ObjectGetInit(ctx context.Context, containerID cid.ID, objectID oid.ID, signer user.Signer, prm client.PrmObjectGet) (object.Object, *client.PayloadReader, error)
	ObjectHead(ctx context.Context, containerID cid.ID, objectID oid.ID, signer user.Signer, prm client.PrmObjectHead) (*object.Object, error)
	ObjectSearchInit(ctx context.Context, containerID cid.ID, signer user.Signer, prm client.PrmObjectSearch) (*client.ObjectListReader, error)
	SearchObjects(context.Context, cid.ID, object.SearchFilters, []string, string, neofscrypto.Signer, client.SearchObjectsOptions) ([]client.SearchResultItem, string, error)
	ObjectRangeInit(ctx context.Context, containerID cid.ID, objectID oid.ID, offset, length uint64, signer user.Signer, prm client.PrmObjectRange) (*client.ObjectRangeReader, error)
	ObjectHash(ctx context.Context, containerID cid.ID, objectID oid.ID, signer user.Signer, prm client.PrmObjectHash) ([][]byte, error)
	AnnounceLocalTrust(ctx context.Context, epoch uint64, trusts []reputationSDK.Trust, prm client.PrmAnnounceLocalTrust) error
	AnnounceIntermediateTrust(ctx context.Context, epoch uint64, trust reputationSDK.PeerToPeerTrust, prm client.PrmAnnounceIntermediateTrust) error
}

Client is an interface of NeoFS storage node's client.

type MultiAddressClient added in v0.27.5

type MultiAddressClient interface {
	Client

	// ForEachGRPCConn executes op over gRPC connections to given multi-address
	// endpoint-by-endpoint until success.
	ForEachGRPCConn(context.Context, func(context.Context, *grpc.ClientConn) error) error
}

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

type NodeInfo added in v0.26.0

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

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

func (NodeInfo) AddressGroup added in v0.26.0

func (x NodeInfo) AddressGroup() network.AddressGroup

AddressGroup returns a group of network addresses.

func (*NodeInfo) PublicKey added in v0.26.0

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

PublicKey returns a public key in a binary format.

Result must not be mutated.

func (*NodeInfo) SetAddressGroup added in v0.26.0

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

SetAddressGroup sets a group of network addresses.

func (*NodeInfo) SetPublicKey added in v0.26.0

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