client

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 33 Imported by: 70

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFullObject

func GetFullObject(ctx context.Context, c *Client, idCnr cid.ID, idObj oid.ID) (*object.Object, error)

GetFullObject reads object header and full payload to the memory and returns the result.

Function behavior equivalent to Client.ObjectGetInit, see documentation for details.

func IsErrContainerNotFound

func IsErrContainerNotFound(err error) bool

IsErrContainerNotFound checks if err corresponds to NeoFS status return corresponding to missing container.

func IsErrObjectAlreadyRemoved

func IsErrObjectAlreadyRemoved(err error) bool

IsErrObjectAlreadyRemoved checks if err corresponds to NeoFS status return corresponding to already removed object.

func IsErrObjectNotFound

func IsErrObjectNotFound(err error) bool

IsErrObjectNotFound checks if err corresponds to NeoFS status return corresponding to missing object.

Types

type Client

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

Client is a wrapper over raw NeoFS API client.

It is not allowed to override client's behaviour: the parameters for the all operations are write-only and the results of the all operations are read-only.

Working client must be created via constructor New. Using the Client that has been created with new(Client) expression (or just declaring a Client variable) is unsafe and can lead to panic.

Each method which produces a NeoFS API call may return a server response. Status responses are returned in the result structure, and can be cast to built-in error instance (or in the returned error if the client is configured accordingly). Certain statuses can be checked using `apistatus` and standard `errors` packages. Note that package provides some helper functions to work with status returns (e.g. IsErrContainerNotFound). All possible responses are documented in methods, however, some may be returned from all of them (pay attention to the presence of the pointer sign):

  • *apistatus.ServerInternal on internal server error;
  • *apistatus.SuccessDefaultV2 on default success.

func New

func New(opts ...Option) (*Client, error)

New creates, initializes and returns the Client instance.

If multiple options of the same config value are supplied, the option with the highest index in the arguments will be used.

func (*Client) AnnounceIntermediateTrust

func (c *Client) AnnounceIntermediateTrust(ctx context.Context, prm PrmAnnounceIntermediateTrust) (*ResAnnounceIntermediateTrust, error)

AnnounceIntermediateTrust sends global trust values calculated for the specified NeoFS network participants at some stage of client's calculation algorithm.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`. If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Immediately panics if parameters are set incorrectly (see PrmAnnounceIntermediateTrust docs). Context is required and must not be nil. It is used for network communication.

Return statuses:

  • global (see Client docs).

func (*Client) AnnounceLocalTrust

func (c *Client) AnnounceLocalTrust(ctx context.Context, prm PrmAnnounceLocalTrust) (*ResAnnounceLocalTrust, error)

AnnounceLocalTrust sends client's trust values to the NeoFS network participants.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`. If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Immediately panics if parameters are set incorrectly (see PrmAnnounceLocalTrust docs). Context is required and must not be nil. It is used for network communication.

Return statuses:

  • global (see Client docs).

func (*Client) BalanceGet

func (c *Client) BalanceGet(ctx context.Context, prm PrmBalanceGet) (*ResBalanceGet, error)

BalanceGet requests current balance of the NeoFS account.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`, If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Immediately panics if parameters are set incorrectly (see PrmBalanceGet docs). Context is required and must not be nil. It is used for network communication.

Return statuses:

  • global (see Client docs).

func (*Client) Conn

func (c *Client) Conn() io.Closer

Conn implements Client.Conn method.

func (*Client) ContainerAnnounceUsedSpace

func (c *Client) ContainerAnnounceUsedSpace(ctx context.Context, prm PrmAnnounceSpace) (*ResAnnounceSpace, error)

ContainerAnnounceUsedSpace sends request to announce volume of the space used for the container objects.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`. If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Operation is asynchronous and no guaranteed even in the absence of errors. The required time is also not predictable.

At this moment success can not be checked.

Immediately panics if parameters are set incorrectly (see PrmAnnounceSpace docs). Context is required and must not be nil. It is used for network communication.

Return statuses:

  • global (see Client docs).

func (*Client) ContainerDelete

func (c *Client) ContainerDelete(ctx context.Context, prm PrmContainerDelete) (*ResContainerDelete, error)

ContainerDelete sends request to remove the NeoFS container.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`. If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Operation is asynchronous and no guaranteed even in the absence of errors. The required time is also not predictable.

Success can be verified by reading by identifier (see GetContainer).

Immediately panics if parameters are set incorrectly (see PrmContainerDelete docs). Context is required and must not be nil. It is used for network communication.

Exactly one return value is non-nil. Server status return is returned in ResContainerDelete. Reflects all internal errors in second return value (transport problems, response processing, etc.).

Return statuses:

  • global (see Client docs).

func (*Client) ContainerEACL

func (c *Client) ContainerEACL(ctx context.Context, prm PrmContainerEACL) (*ResContainerEACL, error)

ContainerEACL reads eACL table of the NeoFS container.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`. If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Immediately panics if parameters are set incorrectly (see PrmContainerEACL docs). Context is required and must not be nil. It is used for network communication.

Return statuses:

  • global (see Client docs);
  • *apistatus.ContainerNotFound.

func (*Client) ContainerGet

func (c *Client) ContainerGet(ctx context.Context, prm PrmContainerGet) (*ResContainerGet, error)

ContainerGet reads NeoFS container by ID.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`. If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Immediately panics if parameters are set incorrectly (see PrmContainerGet docs). Context is required and must not be nil. It is used for network communication.

Return statuses:

  • global (see Client docs);
  • *apistatus.ContainerNotFound.

func (*Client) ContainerList

func (c *Client) ContainerList(ctx context.Context, prm PrmContainerList) (*ResContainerList, error)

ContainerList requests identifiers of the account-owned containers.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`. If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Immediately panics if parameters are set incorrectly (see PrmContainerList docs). Context is required and must not be nil. It is used for network communication.

Return statuses:

  • global (see Client docs).

func (*Client) ContainerPut

func (c *Client) ContainerPut(ctx context.Context, prm PrmContainerPut) (*ResContainerPut, error)

ContainerPut sends request to save container in NeoFS.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`. If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Operation is asynchronous and no guaranteed even in the absence of errors. The required time is also not predictable.

Success can be verified by reading by identifier (see ResContainerPut.ID).

Immediately panics if parameters are set incorrectly (see PrmContainerPut docs). Context is required and must not be nil. It is used for network communication.

Return statuses:

  • global (see Client docs).

func (*Client) ContainerSetEACL

func (c *Client) ContainerSetEACL(ctx context.Context, prm PrmContainerSetEACL) (*ResContainerSetEACL, error)

ContainerSetEACL sends request to update eACL table of the NeoFS container.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`. If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Operation is asynchronous and no guaranteed even in the absence of errors. The required time is also not predictable.

Success can be verified by reading by identifier (see EACL).

Immediately panics if parameters are set incorrectly (see PrmContainerSetEACL docs). Context is required and must not be nil. It is used for network communication.

Return statuses:

  • global (see Client docs).

func (*Client) EndpointInfo

func (c *Client) EndpointInfo(ctx context.Context, prm PrmEndpointInfo) (*ResEndpointInfo, error)

EndpointInfo requests information about the storage node served on the remote endpoint.

Method can be used as a health check to see if node is alive and responds to requests.

Any client's internal or transport errors are returned as `error`. If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Immediately panics if parameters are set incorrectly (see PrmEndpointInfo docs). Context is required and must not be nil. It is used for network communication.

Exactly one return value is non-nil. Server status return is returned in ResEndpointInfo. Reflects all internal errors in second return value (transport problems, response processing, etc.).

Return statuses:

  • global (see Client docs).

func (*Client) NetworkInfo

func (c *Client) NetworkInfo(ctx context.Context, prm PrmNetworkInfo) (*ResNetworkInfo, error)

NetworkInfo requests information about the NeoFS network of which the remote server is a part.

Any client's internal or transport errors are returned as `error`. If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Immediately panics if parameters are set incorrectly (see PrmNetworkInfo docs). Context is required and must not be nil. It is used for network communication.

Exactly one return value is non-nil. Server status return is returned in ResNetworkInfo. Reflects all internal errors in second return value (transport problems, response processing, etc.).

Return statuses:

  • global (see Client docs).

func (*Client) ObjectDelete

func (c *Client) ObjectDelete(ctx context.Context, prm PrmObjectDelete) (*ResObjectDelete, error)

ObjectDelete marks an object for deletion from the container using NeoFS API protocol. As a marker, a special unit called a tombstone is placed in the container. It confirms the user's intent to delete the object, and is itself a container object. Explicit deletion is done asynchronously, and is generally not guaranteed.

Returns a list of checksums in raw form: the format of hashes and their number is left for the caller to check. Client preserves the order of the server's response.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`, If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Immediately panics if parameters are set incorrectly (see PrmObjectDelete docs). Context is required and must not be nil. It is used for network communication.

Return statuses:

  • global (see Client docs)
  • *apistatus.ContainerNotFound;
  • *apistatus.ObjectAccessDenied;
  • *apistatus.ObjectLocked;
  • *apistatus.SessionTokenExpired.

func (*Client) ObjectGetInit

func (c *Client) ObjectGetInit(ctx context.Context, prm PrmObjectGet) (*ObjectReader, error)

ObjectGetInit initiates reading an object through a remote server using NeoFS API protocol.

The call only opens the transmission channel, explicit fetching is done using the ObjectReader. Exactly one return value is non-nil. Resulting reader must be finally closed.

Immediately panics if parameters are set incorrectly (see PrmObjectGet docs). Context is required and must not be nil. It is used for network communication.

func (*Client) ObjectHash

func (c *Client) ObjectHash(ctx context.Context, prm PrmObjectHash) (*ResObjectHash, error)

ObjectHash requests checksum of the range list of the object payload using NeoFS API protocol.

Returns a list of checksums in raw form: the format of hashes and their number is left for the caller to check. Client preserves the order of the server's response.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`, If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Immediately panics if parameters are set incorrectly (see PrmObjectHash docs). Context is required and must not be nil. It is used for network communication.

Return statuses:

  • global (see Client docs);
  • *apistatus.ContainerNotFound;
  • *apistatus.ObjectNotFound;
  • *apistatus.ObjectAccessDenied;
  • *apistatus.SessionTokenExpired.

func (*Client) ObjectHead

func (c *Client) ObjectHead(ctx context.Context, prm PrmObjectHead) (*ResObjectHead, error)

ObjectHead reads object header through a remote server using NeoFS API protocol.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`, If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Immediately panics if parameters are set incorrectly (see PrmObjectHead docs). Context is required and must not be nil. It is used for network communication.

Return errors:

*object.SplitInfoError (returned on virtual objects with PrmObjectHead.MakeRaw).

Return statuses:

  • global (see Client docs);
  • *apistatus.ContainerNotFound;
  • *apistatus.ObjectNotFound;
  • *apistatus.ObjectAccessDenied;
  • *apistatus.ObjectAlreadyRemoved;
  • *apistatus.SessionTokenExpired.

func (*Client) ObjectPutInit

func (c *Client) ObjectPutInit(ctx context.Context, _ PrmObjectPutInit) (*ObjectWriter, error)

ObjectPutInit initiates writing an object through a remote server using NeoFS API protocol.

The call only opens the transmission channel, explicit recording is done using the ObjectWriter. Exactly one return value is non-nil. Resulting writer must be finally closed.

Context is required and must not be nil. It is used for network communication.

func (*Client) ObjectRangeInit

func (c *Client) ObjectRangeInit(ctx context.Context, prm PrmObjectRange) (*ObjectRangeReader, error)

ObjectRangeInit initiates reading an object's payload range through a remote server using NeoFS API protocol.

The call only opens the transmission channel, explicit fetching is done using the ObjectRangeReader. Exactly one return value is non-nil. Resulting reader must be finally closed.

Immediately panics if parameters are set incorrectly (see PrmObjectRange docs). Context is required and must not be nil. It is used for network communication.

func (*Client) ObjectSearchInit

func (c *Client) ObjectSearchInit(ctx context.Context, prm PrmObjectSearch) (*ObjectListReader, error)

ObjectSearchInit initiates object selection through a remote server using NeoFS API protocol.

The call only opens the transmission channel, explicit fetching of matched objects is done using the ObjectListReader. Exactly one return value is non-nil. Resulting reader must be finally closed.

Immediately panics if parameters are set incorrectly (see PrmObjectSearch docs). Context is required and must not be nil. It is used for network communication.

func (*Client) Raw

func (c *Client) Raw() *client.Client

Raw returns underlying raw protobuf client.

func (*Client) SessionCreate

func (c *Client) SessionCreate(ctx context.Context, prm PrmSessionCreate) (*ResSessionCreate, error)

SessionCreate opens a session with the node server on the remote endpoint. The session lifetime coincides with the server lifetime. Results can be written to session token which can be later attached to the requests.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as `error`. If WithNeoFSErrorParsing option has been provided, unsuccessful NeoFS status codes are returned as `error`, otherwise, are included in the returned result structure.

Immediately panics if parameters are set incorrectly (see PrmSessionCreate docs). Context is required and must not be nil. It is used for network communication.

Return statuses:

  • global (see Client docs).

type ObjectListReader

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

ObjectListReader is designed to read list of object identifiers from NeoFS system.

Must be initialized using Client.ObjectSearch, any other usage is unsafe.

func (*ObjectListReader) Close

func (x *ObjectListReader) Close() (*ResObjectSearch, error)

Close ends reading list of the matched objects and returns the result of the operation along with the final results. Must be called after using the ObjectListReader.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as Go built-in error. If Client is tuned to resolve NeoFS API statuses, then NeoFS failures codes are returned as error.

Return statuses:

  • global (see Client docs);
  • *apistatus.ContainerNotFound;
  • *apistatus.ObjectAccessDenied;
  • *apistatus.SessionTokenExpired.

func (*ObjectListReader) Iterate

func (x *ObjectListReader) Iterate(f func(oid.ID) bool) error

Iterate iterates over the list of found object identifiers. f can return true to stop iteration earlier.

Returns an error if object can't be read.

func (*ObjectListReader) Read

func (x *ObjectListReader) Read(buf []oid.ID) (int, bool)

Read reads another list of the object identifiers. Works similar to io.Reader.Read but copies oid.ID and returns success flag instead of error.

Failure reason can be received via Close.

Panics if buf has zero length.

func (*ObjectListReader) UseKey

func (x *ObjectListReader) UseKey(key ecdsa.PrivateKey)

UseKey specifies private key to sign the requests. If key is not provided, then Client default key is used.

type ObjectRangeReader

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

ObjectRangeReader is designed to read payload range of one object from NeoFS system.

Must be initialized using Client.ObjectRangeInit, any other usage is unsafe.

func (*ObjectRangeReader) Close

func (x *ObjectRangeReader) Close() (*ResObjectRange, error)

Close ends reading the payload range and returns the result of the operation along with the final results. Must be called after using the ObjectRangeReader.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as Go built-in error. If Client is tuned to resolve NeoFS API statuses, then NeoFS failures codes are returned as error.

Return errors:

*object.SplitInfoError (returned on virtual objects with PrmObjectRange.MakeRaw).

Return statuses:

  • global (see Client docs);
  • *apistatus.ContainerNotFound;
  • *apistatus.ObjectNotFound;
  • *apistatus.ObjectAccessDenied;
  • *apistatus.ObjectAlreadyRemoved;
  • *apistatus.SessionTokenExpired.

func (*ObjectRangeReader) Read

func (x *ObjectRangeReader) Read(p []byte) (int, error)

Read implements io.Reader of the object payload.

func (*ObjectRangeReader) ReadChunk

func (x *ObjectRangeReader) ReadChunk(buf []byte) (int, bool)

ReadChunk reads another chunk of the object payload range. Works similar to io.Reader.Read but returns success flag instead of error.

Failure reason can be received via Close.

func (*ObjectRangeReader) UseKey

func (x *ObjectRangeReader) UseKey(key ecdsa.PrivateKey)

UseKey specifies private key to sign the requests. If key is not provided, then Client default key is used.

type ObjectReader

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

ObjectReader is designed to read one object from NeoFS system.

Must be initialized using Client.ObjectGetInit, any other usage is unsafe.

func (*ObjectReader) Close

func (x *ObjectReader) Close() (*ResObjectGet, error)

Close ends reading the object and returns the result of the operation along with the final results. Must be called after using the ObjectReader.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as Go built-in error. If Client is tuned to resolve NeoFS API statuses, then NeoFS failures codes are returned as error.

Return errors:

*object.SplitInfoError (returned on virtual objects with PrmObjectGet.MakeRaw).

Return statuses:

  • global (see Client docs);
  • *apistatus.ContainerNotFound;
  • *apistatus.ObjectNotFound;
  • *apistatus.ObjectAccessDenied;
  • *apistatus.ObjectAlreadyRemoved;
  • *apistatus.SessionTokenExpired.

func (*ObjectReader) Read

func (x *ObjectReader) Read(p []byte) (int, error)

Read implements io.Reader of the object payload.

func (*ObjectReader) ReadChunk

func (x *ObjectReader) ReadChunk(buf []byte) (int, bool)

ReadChunk reads another chunk of the object payload. Works similar to io.Reader.Read but returns success flag instead of error.

Failure reason can be received via Close.

func (*ObjectReader) ReadHeader

func (x *ObjectReader) ReadHeader(dst *object.Object) bool

ReadHeader reads header of the object. Result means success. Failure reason can be received via Close.

func (*ObjectReader) UseKey

func (x *ObjectReader) UseKey(key ecdsa.PrivateKey)

UseKey specifies private key to sign the requests. If key is not provided, then Client default key is used.

type ObjectWriter

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

ObjectWriter is designed to write one object to NeoFS system.

Must be initialized using Client.ObjectPutInit, any other usage is unsafe.

func (*ObjectWriter) Close

func (x *ObjectWriter) Close() (*ResObjectPut, error)

Close ends writing the object and returns the result of the operation along with the final results. Must be called after using the ObjectWriter.

Exactly one return value is non-nil. By default, server status is returned in res structure. Any client's internal or transport errors are returned as Go built-in error. If Client is tuned to resolve NeoFS API statuses, then NeoFS failures codes are returned as error.

Return statuses:

  • global (see Client docs);
  • *apistatus.ContainerNotFound;
  • *apistatus.ObjectAccessDenied;
  • *apistatus.ObjectLocked;
  • *apistatus.LockNonRegularObject;
  • *apistatus.SessionTokenNotFound;
  • *apistatus.SessionTokenExpired.

func (*ObjectWriter) MarkLocal

func (x *ObjectWriter) MarkLocal()

MarkLocal tells the server to execute the operation locally.

func (*ObjectWriter) UseKey

func (x *ObjectWriter) UseKey(key ecdsa.PrivateKey)

UseKey specifies private key to sign the requests. If key is not provided, then Client default key is used.

func (*ObjectWriter) WithBearerToken

func (x *ObjectWriter) WithBearerToken(t token.BearerToken)

WithBearerToken attaches bearer token to be used for the operation. Should be called once before any writing steps.

func (*ObjectWriter) WithXHeaders

func (x *ObjectWriter) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

func (*ObjectWriter) WithinSession

func (x *ObjectWriter) WithinSession(t session.Token)

WithinSession specifies session within which object should be stored. Should be called once before any writing steps.

func (*ObjectWriter) WriteHeader

func (x *ObjectWriter) WriteHeader(hdr object.Object) bool

WriteHeader writes header of the object. Result means success. Failure reason can be received via Close.

func (*ObjectWriter) WritePayloadChunk

func (x *ObjectWriter) WritePayloadChunk(chunk []byte) bool

WritePayloadChunk writes chunk of the object payload. Result means success. Failure reason can be received via Close.

type Option

type Option func(*clientOptions)

func WithAddress

func WithAddress(addr string) Option

WithAddress returns option to specify network address of the remote server.

Ignored if WithGRPCConnection is provided.

func WithDefaultPrivateKey

func WithDefaultPrivateKey(key *ecdsa.PrivateKey) Option

WithDefaultPrivateKey returns option to set default private key used for the work.

func WithDialTimeout

func WithDialTimeout(dur time.Duration) Option

WithDialTimeout returns option to set connection timeout to the remote node.

Ignored if WithGRPCConn is provided.

func WithGRPCConnection

func WithGRPCConnection(grpcConn *grpc.ClientConn) Option

WithGRPCConnection returns option to set GRPC connection to the remote node.

func WithNeoFSErrorParsing

func WithNeoFSErrorParsing() Option

WithNeoFSErrorParsing returns option that makes client parse erroneous NeoFS statuses and return them as `error` of the method call.

func WithNetworkMagic

func WithNetworkMagic(magic uint64) Option

WithNetworkMagic returns option to specify NeoFS network magic.

func WithRWTimeout

func WithRWTimeout(dur time.Duration) Option

WithRWTimeout returns option to set timeout for single read and write operation on protobuf message.

func WithResponseInfoHandler

func WithResponseInfoHandler(f func(ResponseMetaInfo) error) Option

WithResponseInfoHandler allows specifying handler of response meta information for the all Client operations. The handler is called right after the response is received. Client returns handler's error immediately.

func WithTLSConfig

func WithTLSConfig(cfg *tls.Config) Option

WithTLSConfig returns option to set connection's TLS config to the remote node.

Ignored if WithGRPCConnection is provided.

func WithURIAddress

func WithURIAddress(addr string, tlsCfg *tls.Config) Option

WithURIAddress returns option to specify network address of a remote server and connection scheme for it.

Format of the URI:

[scheme://]host:port

Supported schemes:

  • grpc;
  • grpcs.

tls.Cfg second argument is optional and is taken into account only in case of `grpcs` scheme.

Falls back to WithNetworkAddress if address is not a valid URI.

Do not use along with WithAddress and WithTLSConfig.

Ignored if WithGRPCConnection is provided.

type PrmAnnounceIntermediateTrust

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

PrmAnnounceIntermediateTrust groups parameters of AnnounceIntermediateTrust operation.

func (*PrmAnnounceIntermediateTrust) SetCurrentValue

func (x *PrmAnnounceIntermediateTrust) SetCurrentValue(trust reputation.PeerToPeerTrust)

SetCurrentValue sets current global trust value computed at the specified iteration of the client's calculation algorithm. Required parameter.

func (*PrmAnnounceIntermediateTrust) SetEpoch

func (x *PrmAnnounceIntermediateTrust) SetEpoch(epoch uint64)

SetEpoch sets number of NeoFS epoch with which client's calculation algorithm is initialized. Required parameter, must not be zero.

func (*PrmAnnounceIntermediateTrust) SetIteration

func (x *PrmAnnounceIntermediateTrust) SetIteration(iter uint32)

SetIteration sets current sequence number of the client's calculation algorithm. By default, corresponds to initial (zero) iteration.

func (*PrmAnnounceIntermediateTrust) WithXHeaders

func (x *PrmAnnounceIntermediateTrust) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

type PrmAnnounceLocalTrust

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

PrmAnnounceLocalTrust groups parameters of AnnounceLocalTrust operation.

func (*PrmAnnounceLocalTrust) SetEpoch

func (x *PrmAnnounceLocalTrust) SetEpoch(epoch uint64)

SetEpoch sets number of NeoFS epoch in which the trust was assessed. Required parameter, must not be zero.

func (*PrmAnnounceLocalTrust) SetValues

func (x *PrmAnnounceLocalTrust) SetValues(trusts []reputation.Trust)

SetValues sets values describing trust of the client to the NeoFS network participants. Required parameter. Must not be empty.

Must not be mutated before the end of the operation.

func (*PrmAnnounceLocalTrust) WithXHeaders

func (x *PrmAnnounceLocalTrust) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

type PrmAnnounceSpace

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

PrmAnnounceSpace groups parameters of ContainerAnnounceUsedSpace operation.

func (*PrmAnnounceSpace) SetValues

func (x *PrmAnnounceSpace) SetValues(announcements []container.UsedSpaceAnnouncement)

SetValues sets values describing volume of space that is used for the container objects. Required parameter. Must not be empty.

Must not be mutated before the end of the operation.

func (*PrmAnnounceSpace) WithXHeaders

func (x *PrmAnnounceSpace) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

type PrmBalanceGet

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

PrmBalanceGet groups parameters of BalanceGet operation.

func (*PrmBalanceGet) SetAccount

func (x *PrmBalanceGet) SetAccount(id owner.ID)

SetAccount sets identifier of the NeoFS account for which the balance is requested. Required parameter. Must be a valid ID according to NeoFS API protocol.

func (*PrmBalanceGet) WithXHeaders

func (x *PrmBalanceGet) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

type PrmContainerDelete

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

PrmContainerDelete groups parameters of ContainerDelete operation.

func (*PrmContainerDelete) SetContainer

func (x *PrmContainerDelete) SetContainer(id cid.ID)

SetContainer sets identifier of the NeoFS container to be removed. Required parameter.

func (*PrmContainerDelete) SetSessionToken

func (x *PrmContainerDelete) SetSessionToken(tok session.Token)

SetSessionToken sets token of the session within which request should be sent.

func (*PrmContainerDelete) WithXHeaders

func (x *PrmContainerDelete) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

type PrmContainerEACL

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

PrmContainerEACL groups parameters of ContainerEACL operation.

func (*PrmContainerEACL) SetContainer

func (x *PrmContainerEACL) SetContainer(id cid.ID)

SetContainer sets identifier of the NeoFS container to read the eACL table. Required parameter.

func (*PrmContainerEACL) WithXHeaders

func (x *PrmContainerEACL) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

type PrmContainerGet

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

PrmContainerGet groups parameters of ContainerGet operation.

func (*PrmContainerGet) SetContainer

func (x *PrmContainerGet) SetContainer(id cid.ID)

SetContainer sets identifier of the container to be read. Required parameter.

func (*PrmContainerGet) WithXHeaders

func (x *PrmContainerGet) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

type PrmContainerList

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

PrmContainerList groups parameters of ContainerList operation.

func (*PrmContainerList) SetAccount

func (x *PrmContainerList) SetAccount(id owner.ID)

SetAccount sets identifier of the NeoFS account to list the containers. Required parameter. Must be a valid ID according to NeoFS API protocol.

func (*PrmContainerList) WithXHeaders

func (x *PrmContainerList) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

type PrmContainerPut

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

PrmContainerPut groups parameters of ContainerPut operation.

func (*PrmContainerPut) SetContainer

func (x *PrmContainerPut) SetContainer(cnr container.Container)

SetContainer sets structured information about new NeoFS container. Required parameter.

func (*PrmContainerPut) WithXHeaders

func (x *PrmContainerPut) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

type PrmContainerSetEACL

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

PrmContainerSetEACL groups parameters of ContainerSetEACL operation.

func (*PrmContainerSetEACL) SetTable

func (x *PrmContainerSetEACL) SetTable(table eacl.Table)

SetTable sets eACL table structure to be set for the container. Required parameter.

func (*PrmContainerSetEACL) WithXHeaders

func (x *PrmContainerSetEACL) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

type PrmEndpointInfo

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

PrmEndpointInfo groups parameters of EndpointInfo operation.

func (*PrmEndpointInfo) WithXHeaders

func (x *PrmEndpointInfo) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

type PrmNetworkInfo

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

PrmNetworkInfo groups parameters of NetworkInfo operation.

func (*PrmNetworkInfo) WithXHeaders

func (x *PrmNetworkInfo) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

type PrmObjectDelete

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

PrmObjectDelete groups parameters of ObjectDelete operation.

func (*PrmObjectDelete) ByID

func (x *PrmObjectDelete) ByID(id oid.ID)

ByID specifies identifier of the requested object. Required parameter.

func (*PrmObjectDelete) FromContainer

func (x *PrmObjectDelete) FromContainer(id cid.ID)

FromContainer specifies NeoFS container of the object. Required parameter.

func (*PrmObjectDelete) UseKey

func (x *PrmObjectDelete) UseKey(key ecdsa.PrivateKey)

UseKey specifies private key to sign the requests. If key is not provided, then Client default key is used.

func (*PrmObjectDelete) WithBearerToken

func (x *PrmObjectDelete) WithBearerToken(t token.BearerToken)

WithBearerToken attaches bearer token to be used for the operation.

If set, underlying eACL rules will be used in access control.

Must be signed.

func (*PrmObjectDelete) WithXHeaders

func (x *PrmObjectDelete) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

func (*PrmObjectDelete) WithinSession

func (x *PrmObjectDelete) WithinSession(t session.Token)

WithinSession specifies session within which object should be read.

Creator of the session acquires the authorship of the request. This may affect the execution of an operation (e.g. access control).

Must be signed.

type PrmObjectGet

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

PrmObjectGet groups parameters of ObjectGetInit operation.

func (*PrmObjectGet) ByID

func (x *PrmObjectGet) ByID(id oid.ID)

ByID specifies identifier of the requested object. Required parameter.

func (*PrmObjectGet) FromContainer

func (x *PrmObjectGet) FromContainer(id cid.ID)

FromContainer specifies NeoFS container of the object. Required parameter.

func (*PrmObjectGet) MarkLocal

func (x *PrmObjectGet) MarkLocal()

MarkLocal tells the server to execute the operation locally.

func (*PrmObjectGet) MarkRaw

func (x *PrmObjectGet) MarkRaw()

MarkRaw marks an intent to read physically stored object.

func (*PrmObjectGet) WithBearerToken

func (x *PrmObjectGet) WithBearerToken(t token.BearerToken)

WithBearerToken attaches bearer token to be used for the operation.

If set, underlying eACL rules will be used in access control.

Must be signed.

func (*PrmObjectGet) WithinSession

func (x *PrmObjectGet) WithinSession(t session.Token)

WithinSession specifies session within which object should be read.

Creator of the session acquires the authorship of the request. This may affect the execution of an operation (e.g. access control).

Must be signed.

type PrmObjectHash

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

PrmObjectHash groups parameters of ObjectHash operation.

func (*PrmObjectHash) ByID

func (x *PrmObjectHash) ByID(id oid.ID)

ByID specifies identifier of the requested object. Required parameter.

func (*PrmObjectHash) FromContainer

func (x *PrmObjectHash) FromContainer(id cid.ID)

FromContainer specifies NeoFS container of the object. Required parameter.

func (*PrmObjectHash) MarkLocal

func (x *PrmObjectHash) MarkLocal()

MarkLocal tells the server to execute the operation locally.

func (*PrmObjectHash) SetRangeList

func (x *PrmObjectHash) SetRangeList(r ...uint64)

SetRangeList sets list of ranges in (offset, length) pair format. Required parameter.

If passed as slice, then it must not be mutated before the operation completes.

func (*PrmObjectHash) TillichZemorAlgo

func (x *PrmObjectHash) TillichZemorAlgo()

TillichZemorAlgo changes the hash function to Tillich-Zemor (https://link.springer.com/content/pdf/10.1007/3-540-48658-5_5.pdf).

By default, SHA256 hash function is used.

func (*PrmObjectHash) UseSalt

func (x *PrmObjectHash) UseSalt(salt []byte)

UseSalt sets the salt to XOR the data range before hashing.

Must not be mutated before the operation completes.

func (*PrmObjectHash) WithBearerToken

func (x *PrmObjectHash) WithBearerToken(t token.BearerToken)

WithBearerToken attaches bearer token to be used for the operation.

If set, underlying eACL rules will be used in access control.

Must be signed.

func (*PrmObjectHash) WithXHeaders

func (x *PrmObjectHash) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

func (*PrmObjectHash) WithinSession

func (x *PrmObjectHash) WithinSession(t session.Token)

WithinSession specifies session within which object should be read.

Creator of the session acquires the authorship of the request. This may affect the execution of an operation (e.g. access control).

Must be signed.

type PrmObjectHead

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

PrmObjectHead groups parameters of ObjectHead operation.

func (*PrmObjectHead) ByID

func (x *PrmObjectHead) ByID(id oid.ID)

ByID specifies identifier of the requested object. Required parameter.

func (*PrmObjectHead) FromContainer

func (x *PrmObjectHead) FromContainer(id cid.ID)

FromContainer specifies NeoFS container of the object. Required parameter.

func (*PrmObjectHead) MarkLocal

func (x *PrmObjectHead) MarkLocal()

MarkLocal tells the server to execute the operation locally.

func (*PrmObjectHead) MarkRaw

func (x *PrmObjectHead) MarkRaw()

MarkRaw marks an intent to read physically stored object.

func (*PrmObjectHead) UseKey

func (x *PrmObjectHead) UseKey(key ecdsa.PrivateKey)

UseKey specifies private key to sign the requests. If key is not provided, then Client default key is used.

func (*PrmObjectHead) WithBearerToken

func (x *PrmObjectHead) WithBearerToken(t token.BearerToken)

WithBearerToken attaches bearer token to be used for the operation.

If set, underlying eACL rules will be used in access control.

Must be signed.

func (*PrmObjectHead) WithinSession

func (x *PrmObjectHead) WithinSession(t session.Token)

WithinSession specifies session within which object should be read.

Creator of the session acquires the authorship of the request. This may affect the execution of an operation (e.g. access control).

Must be signed.

type PrmObjectPutInit

type PrmObjectPutInit struct{}

PrmObjectPutInit groups parameters of ObjectPutInit operation.

At the moment the operation is not parameterized, however, the structure is still declared for backward compatibility.

type PrmObjectRange

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

PrmObjectRange groups parameters of ObjectRange operation.

func (*PrmObjectRange) ByID

func (x *PrmObjectRange) ByID(id oid.ID)

ByID specifies identifier of the requested object. Required parameter.

func (*PrmObjectRange) FromContainer

func (x *PrmObjectRange) FromContainer(id cid.ID)

FromContainer specifies NeoFS container of the object. Required parameter.

func (*PrmObjectRange) MarkLocal

func (x *PrmObjectRange) MarkLocal()

MarkLocal tells the server to execute the operation locally.

func (*PrmObjectRange) MarkRaw

func (x *PrmObjectRange) MarkRaw()

MarkRaw marks an intent to read physically stored object.

func (*PrmObjectRange) SetLength

func (x *PrmObjectRange) SetLength(ln uint64)

SetLength sets length of the payload range to be read. Must be positive.

func (*PrmObjectRange) SetOffset

func (x *PrmObjectRange) SetOffset(off uint64)

SetOffset sets offset of the payload range to be read. Zero by default.

func (*PrmObjectRange) WithBearerToken

func (x *PrmObjectRange) WithBearerToken(t token.BearerToken)

WithBearerToken attaches bearer token to be used for the operation.

If set, underlying eACL rules will be used in access control.

Must be signed.

func (*PrmObjectRange) WithinSession

func (x *PrmObjectRange) WithinSession(t session.Token)

WithinSession specifies session within which object should be read.

Creator of the session acquires the authorship of the request. This may affect the execution of an operation (e.g. access control).

Must be signed.

type PrmObjectSearch

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

PrmObjectSearch groups parameters of ObjectSearch operation.

func (*PrmObjectSearch) InContainer

func (x *PrmObjectSearch) InContainer(id cid.ID)

InContainer specifies the container in which to look for objects. Required parameter.

func (*PrmObjectSearch) MarkLocal

func (x *PrmObjectSearch) MarkLocal()

MarkLocal tells the server to execute the operation locally.

func (*PrmObjectSearch) SetFilters

func (x *PrmObjectSearch) SetFilters(filters object.SearchFilters)

SetFilters sets filters by which to select objects. All container objects match unset/empty filters.

func (*PrmObjectSearch) WithBearerToken

func (x *PrmObjectSearch) WithBearerToken(t token.BearerToken)

WithBearerToken attaches bearer token to be used for the operation.

If set, underlying eACL rules will be used in access control.

Must be signed.

func (*PrmObjectSearch) WithXHeaders

func (x *PrmObjectSearch) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

func (*PrmObjectSearch) WithinSession

func (x *PrmObjectSearch) WithinSession(t session.Token)

WithinSession specifies session within which the search query must be executed.

Creator of the session acquires the authorship of the request. This may affect the execution of an operation (e.g. access control).

Must be signed.

type PrmSessionCreate

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

PrmSessionCreate groups parameters of SessionCreate operation.

func (*PrmSessionCreate) SetExp

func (x *PrmSessionCreate) SetExp(exp uint64)

SetExp sets number of the last NepFS epoch in the lifetime of the session after which it will be expired.

func (*PrmSessionCreate) WithXHeaders

func (x *PrmSessionCreate) WithXHeaders(hs ...string)

WithXHeaders specifies list of extended headers (string key-value pairs) to be attached to the request. Must have an even length.

Slice must not be mutated until the operation completes.

type ResAnnounceIntermediateTrust

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

ResAnnounceIntermediateTrust groups results of AnnounceIntermediateTrust operation.

func (ResAnnounceIntermediateTrust) Status

func (x ResAnnounceIntermediateTrust) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResAnnounceLocalTrust

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

ResAnnounceLocalTrust groups results of AnnounceLocalTrust operation.

func (ResAnnounceLocalTrust) Status

func (x ResAnnounceLocalTrust) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResAnnounceSpace

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

ResAnnounceSpace groups resulting values of ContainerAnnounceUsedSpace operation.

func (ResAnnounceSpace) Status

func (x ResAnnounceSpace) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResBalanceGet

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

ResBalanceGet groups resulting values of BalanceGet operation.

func (ResBalanceGet) Amount

func (x ResBalanceGet) Amount() *accounting.Decimal

Amount returns current amount of funds on the NeoFS account as decimal number.

Client doesn't retain value so modification is safe.

func (ResBalanceGet) Status

func (x ResBalanceGet) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResContainerDelete

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

ResContainerDelete groups resulting values of ContainerDelete operation.

func (ResContainerDelete) Status

func (x ResContainerDelete) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResContainerEACL

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

ResContainerEACL groups resulting values of ContainerEACL operation.

func (ResContainerEACL) Status

func (x ResContainerEACL) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

func (ResContainerEACL) Table

func (x ResContainerEACL) Table() *eacl.Table

Table returns eACL table of the requested container.

Client doesn't retain value so modification is safe.

type ResContainerGet

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

ResContainerGet groups resulting values of ContainerGet operation.

func (ResContainerGet) Container

func (x ResContainerGet) Container() *container.Container

Container returns structured information about the requested container.

Client doesn't retain value so modification is safe.

func (ResContainerGet) Status

func (x ResContainerGet) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResContainerList

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

ResContainerList groups resulting values of ContainerList operation.

func (ResContainerList) Containers

func (x ResContainerList) Containers() []*cid.ID

Containers returns list of identifiers of the account-owned containers.

Client doesn't retain value so modification is safe.

func (ResContainerList) Status

func (x ResContainerList) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResContainerPut

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

ResContainerPut groups resulting values of ContainerPut operation.

func (ResContainerPut) ID

func (x ResContainerPut) ID() *cid.ID

ID returns identifier of the container declared to be stored in the system. Used as a link to information about the container (in particular, you can asynchronously check if the save was successful).

Client doesn't retain value so modification is safe.

func (ResContainerPut) Status

func (x ResContainerPut) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResContainerSetEACL

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

ResContainerSetEACL groups resulting values of ContainerSetEACL operation.

func (ResContainerSetEACL) Status

func (x ResContainerSetEACL) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResEndpointInfo

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

ResEndpointInfo group resulting values of EndpointInfo operation.

func (ResEndpointInfo) LatestVersion

func (x ResEndpointInfo) LatestVersion() *version.Version

LatestVersion returns latest NeoFS API protocol's version in use.

Client doesn't retain value so modification is safe.

func (ResEndpointInfo) NodeInfo

func (x ResEndpointInfo) NodeInfo() *netmap.NodeInfo

NodeInfo returns information about the NeoFS node served on the remote endpoint.

Client doesn't retain value so modification is safe.

func (ResEndpointInfo) Status

func (x ResEndpointInfo) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResNetworkInfo

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

ResNetworkInfo groups resulting values of NetworkInfo operation.

func (ResNetworkInfo) Info

func (x ResNetworkInfo) Info() *netmap.NetworkInfo

Info returns structured information about the NeoFS network.

Client doesn't retain value so modification is safe.

func (ResNetworkInfo) Status

func (x ResNetworkInfo) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResObjectDelete

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

ResObjectDelete groups resulting values of ObjectDelete operation.

func (ResObjectDelete) ReadTombstoneID

func (x ResObjectDelete) ReadTombstoneID(dst *oid.ID) bool

ReadTombstoneID reads identifier of the created tombstone object. Returns false if ID is missing (not read).

func (ResObjectDelete) Status

func (x ResObjectDelete) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResObjectGet

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

ResObjectGet groups the final result values of ObjectGetInit operation.

func (ResObjectGet) Status

func (x ResObjectGet) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResObjectHash

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

ResObjectHash groups resulting values of ObjectHash operation.

func (ResObjectHash) Checksums

func (x ResObjectHash) Checksums() [][]byte

Checksums returns a list of calculated checksums in range order.

func (ResObjectHash) Status

func (x ResObjectHash) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResObjectHead

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

ResObjectHead groups resulting values of ObjectHead operation.

func (*ResObjectHead) ReadHeader

func (x *ResObjectHead) ReadHeader(dst *object.Object) bool

ReadHeader reads header of the requested object. Returns false if header is missing in the response (not read).

func (ResObjectHead) Status

func (x ResObjectHead) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResObjectPut

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

ResObjectPut groups the final result values of ObjectPutInit operation.

func (*ResObjectPut) ReadStoredObjectID

func (x *ResObjectPut) ReadStoredObjectID(id *oid.ID) bool

ReadStoredObjectID reads identifier of the saved object. Returns false if ID is missing (not read).

func (ResObjectPut) Status

func (x ResObjectPut) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResObjectRange

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

ResObjectRange groups the final result values of ObjectRange operation.

func (ResObjectRange) Status

func (x ResObjectRange) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResObjectSearch

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

ResObjectSearch groups the final result values of ObjectSearch operation.

func (ResObjectSearch) Status

func (x ResObjectSearch) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResSessionCreate

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

ResSessionCreate groups resulting values of SessionCreate operation.

func (ResSessionCreate) ID

func (x ResSessionCreate) ID() []byte

ID returns identifier of the opened session in a binary NeoFS API protocol format.

Client doesn't retain value so modification is safe.

func (ResSessionCreate) PublicKey

func (x ResSessionCreate) PublicKey() []byte

PublicKey returns public key of the opened session in a binary NeoFS API protocol format.

func (ResSessionCreate) Status

func (x ResSessionCreate) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResponseMetaInfo

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

ResponseMetaInfo groups meta information about any NeoFS API response.

func (ResponseMetaInfo) ResponderKey

func (x ResponseMetaInfo) ResponderKey() []byte

ResponderKey returns responder's public key in a binary format.

Result must not be mutated.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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