clientcore

package
v0.58.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAllConnectionsSkipped = errors.New("all connections skipped")

ErrAllConnectionsSkipped allows to check whether MultiAddressClient.ForAnyGRPCConn error is returns because all connections are unavailable or skipped.

View Source
var ErrSkipConnection = errors.New("connection skipped")

ErrSkipConnection is returned to skip connection.

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 CompareAPIVersion added in v0.57.0

func CompareAPIVersion(c MultiAddressClient, v version.Version) int

CompareAPIVersion performs three-way comparison of API server version against the given one.

func IsMutuallyAuthenticated added in v0.56.0

func IsMutuallyAuthenticated(c any) bool

IsMutuallyAuthenticated reports whether all connections of c use mutual TLS. Clients that do not expose this property are treated as unauthenticated.

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)
	SearchObjects(context.Context, cid.ID, object.SearchFilters, []string, string, neofscrypto.Signer, client.SearchObjectsOptions) ([]client.SearchResultItem, string, error)
	AnnounceLocalTrust(ctx context.Context, epoch uint64, trusts []reputation.Trust, prm client.PrmAnnounceLocalTrust) error
	AnnounceIntermediateTrust(ctx context.Context, epoch uint64, trust reputation.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

	// ForAnyGRPCConn executes op over gRPC connections to given multi-address
	// endpoint-by-endpoint until success.
	//
	// If next endpoint is unavailable or f returns [ErrSkipConnection] for it,
	// ForAnyGRPCConn continues. If this happens on all endpoints, ForAnyGRPCConn
	// returns [ErrAllConnectionsSkipped].
	ForAnyGRPCConn(ctx context.Context, f func(context.Context, *grpc.ClientConn) error) error

	// APIVersion returns current protocol version to use in requests using
	// this client (min(server, client) effectively).
	APIVersion() *protorefs.Version
}

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

Jump to

Keyboard shortcuts

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