client

package
v0.0.0-...-20ab57b Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 37 Imported by: 19

Documentation

Overview

Package client provides FrostFS API client implementation.

The main component is Client type. It is a virtual connection to the network and provides methods for executing operations on the server.

Create client instance:

var c client.Client

Initialize client state:

var prm client.PrmInit
prm.SetDefaultPrivateKey(key)
// ...

c.Init(prm)

Connect to the FrostFS server:

var prm client.PrmDial
prm.SetServerURI("localhost:8080")
prm.SetDefaultPrivateKey(key)
// ...

err := c.Dial(prm)
// ...

Execute FrostFS operation on the server:

var prm client.PrmContainerPut
prm.SetContainer(cnr)
// ...

res, err := c.ContainerPut(context.Background(), prm)
err := c.Dial(dialPrm)
if err == nil {
	err = apistatus.ErrFromStatus(res.Status())
}
// ...

Consume custom service of the server:

syntax = "proto3";

service CustomService {
	rpc CustomRPC(CustomRPCRequest) returns (CustomRPCResponse);
}

import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client"
import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/common"

req := new(CustomRPCRequest)
// ...
resp := new(CustomRPCResponse)

err := c.ExecRaw(func(c *client.Client) error {
	return client.SendUnary(c, common.CallMethodInfo{
		Service: "CustomService",
		Name:    "CustomRPC",
	}, req, resp)
})
// ...

Close the connection:

err := c.Close()
// ...

Note that it's not allowed to override Client behaviour directly: the parameters for the all operations are write-only and the results of the all operations are read-only. To be able to override client behavior (e.g. for tests), abstract it with an interface:

import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client"

type FrostFSClient interface {
	// Operations according to the application needs
	CreateContainer(context.Context, container.Container) error
	// ...
}

type client struct {
	c *client.Client
}

func (x *client) CreateContainer(context.Context, container.Container) error {
	// ...
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrContainerNotFound

func IsErrContainerNotFound(err error) bool

IsErrContainerNotFound checks if err corresponds to FrostFS status return corresponding to missing container. Supports wrapped errors.

func IsErrEACLNotFound

func IsErrEACLNotFound(err error) bool

IsErrEACLNotFound checks if err corresponds to FrostFS status return corresponding to missing eACL table. Supports wrapped errors.

func IsErrObjectAlreadyRemoved

func IsErrObjectAlreadyRemoved(err error) bool

IsErrObjectAlreadyRemoved checks if err corresponds to FrostFS status return corresponding to already removed object. Supports wrapped errors.

func IsErrObjectNotFound

func IsErrObjectNotFound(err error) bool

IsErrObjectNotFound checks if err corresponds to FrostFS status return corresponding to missing object. Supports wrapped errors.

func IsErrSessionExpired

func IsErrSessionExpired(err error) bool

IsErrSessionExpired checks if err corresponds to FrostFS status return corresponding to expired session. Supports wrapped errors.

func IsErrSessionNotFound

func IsErrSessionNotFound(err error) bool

IsErrSessionNotFound checks if err corresponds to FrostFS status return corresponding to missing session. Supports wrapped errors.

func SyncContainerWithNetwork

func SyncContainerWithNetwork(ctx context.Context, cnr *container.Container, c *Client) error

SyncContainerWithNetwork requests network configuration using passed client and applies it to the container. Container MUST not be nil.

Note: if container does not match network configuration, SyncContainerWithNetwork changes it.

Returns any network/parsing config errors.

See also NetworkInfo, container.ApplyNetworkConfig.

Types

type Client

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

Client represents virtual connection to the FrostFS network to communicate with FrostFS server using FrostFS API protocol. It is designed to provide an abstraction interface from the protocol details of data transfer over a network in FrostFS.

Client can be created using simple Go variable declaration. Before starting work with the Client, it SHOULD BE correctly initialized (see Init method). Before executing the FrostFS operations using the Client, connection to the server MUST BE correctly established (see Dial method and pay attention to the mandatory parameters). Using the Client before connecting have been established can lead to a panic. After the work, the Client SHOULD BE closed (see Close method): it frees internal and system resources which were allocated for the period of work of the Client. Calling Init/Dial/Close method during the communication process step strongly discouraged as it leads to undefined behavior.

Each method which produces a FrostFS 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.NodeUnderMaintenance if a server is under maintenance;
  • *apistatus.SuccessDefaultV2 on default success.

Client MUST NOT be copied by value: use pointer to Client instead.

See client package overview to get some examples.

func (*Client) BalanceGet

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

BalanceGet requests current balance of the FrostFS 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 PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

Returns an error 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) Close

func (c *Client) Close() error

Close closes underlying connection to the FrostFS server. Implements io.Closer. MUST NOT be called before successful Dial. Can be called concurrently with server operations processing on running goroutines: in this case they are likely to fail due to a connection error.

One-time method call during application shutdown stage (after Init and Dial) is expected. Calling multiple times leads to undefined behavior.

See also Init / Dial.

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 PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

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.

Returns an error 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 FrostFS 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 PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

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).

Returns an error 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 FrostFS 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 PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

Returns an error 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;
  • *apistatus.EACLNotFound.

func (*Client) ContainerGet

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

ContainerGet reads FrostFS 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 PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

Returns an error 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 PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

Returns an error 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 FrostFS.

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 PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

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).

Returns an error 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).

nolint: funlen

func (*Client) ContainerSetEACL

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

ContainerSetEACL sends request to update eACL table of the FrostFS 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 PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

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).

Returns an error 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) Dial

func (c *Client) Dial(ctx context.Context, prm PrmDial) error

Dial establishes a connection to the server from the FrostFS network. Returns an error describing failure reason. If failed, the Client SHOULD NOT be used.

Uses the context specified by SetContext if it was called with non-nil argument, otherwise context.Background() is used. Dial returns context errors, see context package docs for details.

Returns an error if required parameters are set incorrectly, look carefully at the method documentation.

One-time method call during application start-up stage (after Init ) is expected. Calling multiple times leads to undefined behavior.

See also Init / Close.

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 PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

Returns an error 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) ExecRaw

func (c *Client) ExecRaw(f func(client *client.Client) error) error

ExecRaw executes f with underlying git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client.Client instance. Communicate over the Protocol Buffers protocol in a more flexible way: most often used to transmit data over a fixed version of the FrostFS protocol, as well as to support custom services.

The f must not manipulate the client connection passed into it.

Like all other operations, must be called after connecting to the server and before closing the connection.

See also Dial and Close. See also git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client package docs.

func (*Client) Init

func (c *Client) Init(prm PrmInit)

Init brings the Client instance to its initial state.

One-time method call during application init stage (before Dial) is expected. Calling multiple times leads to undefined behavior.

See docs of PrmInit methods for details. See also Dial / Close.

func (*Client) NetMapSnapshot

func (c *Client) NetMapSnapshot(ctx context.Context, _ PrmNetMapSnapshot) (*ResNetMapSnapshot, error)

NetMapSnapshot requests current network view of the remote server.

Any client's internal or transport errors are returned as `error`. If PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

Returns an error if parameters are set incorrectly. 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 ResNetMapSnapshot. 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 FrostFS network of which the remote server is a part.

Any client's internal or transport errors are returned as `error`. If PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

Returns an error 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 FrostFS 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 PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

Returns an error 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 FrostFS 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.

Returns an error 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 FrostFS 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 PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

Returns an error 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.ObjectOutOfRange;
  • *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 FrostFS 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 PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

Returns an error 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, prm PrmObjectPutInit) (ObjectWriter, error)

ObjectPutInit initiates writing an object through a remote server using FrostFS 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.

Returns an error if parameters are set incorrectly. Context is required and must not be nil. It is used for network communication.

func (*Client) ObjectPutSingle

func (c *Client) ObjectPutSingle(ctx context.Context, prm PrmObjectPutSingle) (*ResObjectPutSingle, error)

ObjectPutSingle writes prepared object to FrostFS. Object must have payload, also containerID, objectID, ownerID, payload hash, payload length of an object must be set. 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 FrostFS API statuses, then FrostFS failures codes are returned as error.

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 FrostFS 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.

Returns an error 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 FrostFS 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.

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

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 PrmInit.DisableFrostFSFailuresResolution has been called, unsuccessful FrostFS status codes are included in the returned result structure, otherwise, are also returned as `error`.

Returns an error 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 FrostFS 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 FrostFS API statuses, then FrostFS 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.

type ObjectRangeReader

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

ObjectRangeReader is designed to read payload range of one object from FrostFS 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 FrostFS API statuses, then FrostFS 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.ObjectOutOfRange;
  • *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.

type ObjectReader

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

ObjectReader is designed to read one object from FrostFS 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 FrostFS API statuses, then FrostFS 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.

type ObjectWriter

type ObjectWriter interface {
	// WriteHeader writes header of the object. Result means success.
	// Failure reason can be received via Close.
	WriteHeader(context.Context, object.Object) bool
	// WritePayloadChunk writes chunk of the object payload. Result means success.
	// Failure reason can be received via Close.
	WritePayloadChunk(context.Context, []byte) bool
	// 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 FrostFS API statuses, then FrostFS failures
	// codes are returned as error.
	//
	// Return statuses:
	//   - global (see Client docs);
	//   - *apistatus.ContainerNotFound;
	//   - *apistatus.ObjectAccessDenied;
	//   - *apistatus.ObjectLocked;
	//   - *apistatus.LockNonRegularObject;
	//   - *apistatus.SessionTokenNotFound;
	//   - *apistatus.SessionTokenExpired.
	Close(context.Context) (*ResObjectPut, error)
}

ObjectWriter is designed to write one object or multiple parts of one object to FrostFS system.

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

type PrmAnnounceSpace

type PrmAnnounceSpace struct {
	XHeaders []string

	Announcements []container.SizeEstimation
}

PrmAnnounceSpace groups parameters of ContainerAnnounceUsedSpace operation.

func (*PrmAnnounceSpace) SetValues deprecated

func (x *PrmAnnounceSpace) SetValues(vs []container.SizeEstimation)

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.

Deprecated: Use PrmAnnounceSpace.Announcements instead.

type PrmBalanceGet

type PrmBalanceGet struct {
	XHeaders []string

	Account user.ID
}

PrmBalanceGet groups parameters of BalanceGet operation.

func (*PrmBalanceGet) SetAccount deprecated

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

SetAccount sets identifier of the FrostFS account for which the balance is requested. Required parameter.

Deprecated: Use PrmBalanceGet.Account instead.

type PrmContainerDelete

type PrmContainerDelete struct {
	// FrostFS request X-Headers
	XHeaders []string

	ContainerID *cid.ID

	Session *session.Container
}

PrmContainerDelete groups parameters of ContainerDelete operation.

func (*PrmContainerDelete) SetContainer deprecated

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

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

Deprecated: Use PrmContainerDelete.Container instead.

func (*PrmContainerDelete) WithinSession deprecated

func (prm *PrmContainerDelete) WithinSession(tok session.Container)

WithinSession specifies session within which container should be removed.

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.

Deprecated: Use PrmContainerDelete.Session instead.

type PrmContainerEACL

type PrmContainerEACL struct {
	// FrostFS request X-Headers.
	XHeaders []string

	ContainerID *cid.ID

	Session *session.Container
}

PrmContainerEACL groups parameters of ContainerEACL operation.

func (*PrmContainerEACL) SetContainer deprecated

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

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

Deprecated: Use PrmContainerEACL.ContainerID instead.

type PrmContainerGet

type PrmContainerGet struct {
	// FrostFS request X-Headers.
	XHeaders []string

	ContainerID *cid.ID

	Session *session.Container
}

PrmContainerGet groups parameters of ContainerGet operation.

func (*PrmContainerGet) SetContainer deprecated

func (prm *PrmContainerGet) SetContainer(cid cid.ID)

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

Deprecated: Use PrmContainerGet.ContainerID instead.

type PrmContainerList

type PrmContainerList struct {
	XHeaders []string

	Account user.ID

	Session *session.Container
}

PrmContainerList groups parameters of ContainerList operation.

func (*PrmContainerList) SetAccount deprecated

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

SetAccount sets identifier of the FrostFS account to list the containers. Required parameter.

Deprecated: Use PrmContainerList.Account instead.

type PrmContainerPut

type PrmContainerPut struct {
	// FrostFS request X-Headers
	XHeaders []string

	Container *container.Container

	Session *session.Container
}

PrmContainerPut groups parameters of ContainerPut operation.

func (*PrmContainerPut) SetContainer deprecated

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

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

Deprecated: Use PrmContainerPut.Container instead.

func (*PrmContainerPut) WithinSession deprecated

func (x *PrmContainerPut) WithinSession(s session.Container)

WithinSession specifies session within which container should be saved.

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

Session is optional, if set the following requirements apply:

  • session operation MUST be session.VerbContainerPut (ForVerb)
  • token MUST be signed using private key of the owner of the container to be saved

Deprecated: Use PrmContainerPut.Session instead.

type PrmContainerSetEACL

type PrmContainerSetEACL struct {
	// FrostFS request X-Headers.
	XHeaders []string

	Table *eacl.Table

	Session *session.Container
}

PrmContainerSetEACL groups parameters of ContainerSetEACL operation.

func (*PrmContainerSetEACL) SetTable deprecated

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

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

Deprecated: Use PrmContainerSetEACL.Table instead.

func (*PrmContainerSetEACL) WithinSession deprecated

func (x *PrmContainerSetEACL) WithinSession(s session.Container)

WithinSession specifies session within which extended ACL of the container should be saved.

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

Session is optional, if set the following requirements apply:

  • if particular container is specified (ApplyOnlyTo), it MUST equal the container for which extended ACL is going to be set
  • session operation MUST be session.VerbContainerSetEACL (ForVerb)
  • token MUST be signed using private key of the owner of the container to be saved

Deprecated: Use PrmContainerSetEACL.Session instead.

type PrmDial

type PrmDial struct {
	Endpoint string

	TLSConfig *tls.Config

	// If DialTimeout is non-positive, then it's set to defaultDialTimeout.
	DialTimeout time.Duration

	// If StreamTimeout is non-positive, then it's set to defaultStreamTimeout.
	StreamTimeout time.Duration

	GRPCDialOptions []grpc.DialOption
}

PrmDial groups connection parameters for the Client.

See also Dial.

func (*PrmDial) SetGRPCDialOptions deprecated

func (x *PrmDial) SetGRPCDialOptions(opts ...grpc.DialOption)

SetGRPCDialOptions sets the gRPC dial options for new gRPC client connection.

Deprecated: Use PrmDial.GRPCDialOptions instead.

func (*PrmDial) SetServerURI deprecated

func (x *PrmDial) SetServerURI(endpoint string)

SetServerURI sets server URI in the FrostFS network. Required parameter.

Format of the URI:

[scheme://]host:port

Supported schemes:

grpc
grpcs

See also SetTLSConfig.

Deprecated: Use PrmDial.Endpoint instead.

func (*PrmDial) SetStreamTimeout deprecated

func (x *PrmDial) SetStreamTimeout(timeout time.Duration)

SetStreamTimeout sets the timeout for individual operations in streaming RPC. MUST BE positive. If not called, 10s timeout will be used by default.

Deprecated: Use PrmDial.StreamTimeout instead.

func (*PrmDial) SetTLSConfig

func (x *PrmDial) SetTLSConfig(tlsConfig *tls.Config)

SetTLSConfig sets tls.Config to open TLS client connection to the FrostFS server. Nil (default) means insecure connection.

See also SetServerURI.

Depreacted: Use PrmDial.TLSConfig instead.

func (*PrmDial) SetTimeout deprecated

func (x *PrmDial) SetTimeout(timeout time.Duration)

SetTimeout sets the timeout for connection to be established. MUST BE positive. If not called, 5s timeout will be used by default.

Deprecated: Use PrmDial.DialTimeout instead.

type PrmEndpointInfo

type PrmEndpointInfo struct {
	XHeaders []string
}

PrmEndpointInfo groups parameters of EndpointInfo operation.

type PrmInit

type PrmInit struct {
	DisableFrostFSErrorResolution bool

	Key ecdsa.PrivateKey

	ResponseInfoCallback func(ResponseMetaInfo) error

	NetMagic uint64
}

PrmInit groups initialization parameters of Client instances.

See also Init.

func (*PrmInit) DisableFrostFSFailuresResolution deprecated

func (x *PrmInit) DisableFrostFSFailuresResolution()

DisableFrostFSFailuresResolution makes the Client to preserve failure statuses of the FrostFS protocol only in resulting structure (see corresponding Res* docs). These errors are returned from each protocol operation. By default, statuses are resolved and returned as a Go built-in errors.

Deprecated: Use PrmInit.DisableFrostFSErrorResolution instead.

func (*PrmInit) ResolveFrostFSFailures deprecated

func (x *PrmInit) ResolveFrostFSFailures()

Deprecated: method is no-op. Option is default.

func (*PrmInit) SetDefaultPrivateKey deprecated

func (x *PrmInit) SetDefaultPrivateKey(key ecdsa.PrivateKey)

SetDefaultPrivateKey sets Client private key to be used for the protocol communication by default.

Required for operations without custom key parametrization (see corresponding Prm* docs).

Deprecated: Use PrmInit.Key instead.

func (*PrmInit) SetResponseInfoCallback deprecated

func (x *PrmInit) SetResponseInfoCallback(f func(ResponseMetaInfo) error)

SetResponseInfoCallback makes the Client to pass ResponseMetaInfo from each FrostFS server response to f. Nil (default) means ignore response meta info.

Deprecated: Use PrmInit.ResponseInfoCallback instead.

type PrmNetMapSnapshot

type PrmNetMapSnapshot struct{}

PrmNetMapSnapshot groups parameters of NetMapSnapshot operation.

type PrmNetworkInfo

type PrmNetworkInfo struct {
	XHeaders []string
}

PrmNetworkInfo groups parameters of NetworkInfo operation.

type PrmObjectDelete

type PrmObjectDelete struct {
	XHeaders []string

	BearerToken *bearer.Token

	Session *session.Object

	ContainerID *cid.ID

	ObjectID *oid.ID

	Key *ecdsa.PrivateKey
}

PrmObjectDelete groups parameters of ObjectDelete operation.

func (*PrmObjectDelete) UseKey deprecated

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

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

Deprecated: Use PrmObjectDelete.Key instead.

type PrmObjectGet

type PrmObjectGet struct {
	XHeaders []string

	BearerToken *bearer.Token

	Session *session.Object

	Raw bool

	Local bool

	ContainerID *cid.ID

	ObjectID *oid.ID

	Key *ecdsa.PrivateKey
}

PrmObjectGet groups parameters of ObjectGetInit operation.

func (*PrmObjectGet) UseKey deprecated

func (prm *PrmObjectGet) UseKey(key ecdsa.PrivateKey)

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

Deprecated: Use PrmObjectGet.Key instead.

type PrmObjectHash

type PrmObjectHash struct {
	XHeaders []string

	BearerToken *bearer.Token

	Session *session.Object

	Local bool

	Ranges []object.Range

	Salt []byte

	ChecksumType checksum.Type

	ContainerID *cid.ID

	ObjectID *oid.ID

	Key *ecdsa.PrivateKey
}

PrmObjectHash groups parameters of ObjectHash operation.

func (*PrmObjectHash) TillichZemorAlgo deprecated

func (prm *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/.

Deprecated: Use PrmObjectHash.ChecksumType instead.

func (*PrmObjectHash) UseKey deprecated

func (prm *PrmObjectHash) UseKey(key ecdsa.PrivateKey)

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

Deprecated: Use PrmObjectHash.Key instead.

type PrmObjectHead

type PrmObjectHead struct {
	XHeaders []string

	BearerToken *bearer.Token

	Session *session.Object

	Raw bool

	Local bool

	ContainerID *cid.ID

	ObjectID *oid.ID

	Key *ecdsa.PrivateKey
}

PrmObjectHead groups parameters of ObjectHead operation.

func (*PrmObjectHead) UseKey deprecated

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

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

Deprecated: Use PrmObjectHead.Key instead.

type PrmObjectPutInit

type PrmObjectPutInit struct {
	XHeaders []string

	BearerToken *bearer.Token

	Session *session.Object

	Local bool

	CopiesNumber []uint32

	MaxChunkLength int

	MaxSize uint64

	EpochSource transformer.EpochSource

	WithoutHomomorphHash bool

	Key *ecdsa.PrivateKey

	Pool *buffPool.BufferPool
}

PrmObjectPutInit groups parameters of ObjectPutInit operation.

func (*PrmObjectPutInit) MarkLocal deprecated

func (x *PrmObjectPutInit) MarkLocal()

MarkLocal tells the server to execute the operation locally.

Deprecated: Use PrmObjectPutInit.Local instead.

func (*PrmObjectPutInit) SetCopiesNumber deprecated

func (x *PrmObjectPutInit) SetCopiesNumber(copiesNumber uint32)

SetCopiesNumber sets number of object copies that is enough to consider put successful.

Deprecated: Use PrmObjectPutInit.CopiesNumber instead.

func (*PrmObjectPutInit) SetCopiesNumberByVectors deprecated

func (x *PrmObjectPutInit) SetCopiesNumberByVectors(copiesNumbers []uint32)

SetCopiesNumberByVectors sets ordered list of minimal required object copies numbers per placement vector. List's length MUST equal container's placement vector number, otherwise request will fail.

Deprecated: Use PrmObjectPutInit.CopiesNumber instead.

func (*PrmObjectPutInit) SetGRPCPayloadChunkLen deprecated

func (x *PrmObjectPutInit) SetGRPCPayloadChunkLen(v int)

SetGRPCPayloadChunkLen sets maximum chunk length value for gRPC Put request. Maximum chunk length restricts maximum byte length of the chunk transmitted in a single stream message. It depends on server settings and other message fields. If not specified or negative value set, default value of 3MiB will be used.

Deprecated: Use PrmObjectPutInit.MaxChunkLength instead.

func (*PrmObjectPutInit) UseKey deprecated

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

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

Deprecated: Use PrmObjectPutInit.Key instead.

func (*PrmObjectPutInit) WithBearerToken deprecated

func (x *PrmObjectPutInit) WithBearerToken(t bearer.Token)

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

Deprecated: Use PrmObjectPutInit.BearerToken instead.

func (*PrmObjectPutInit) WithEpochSource deprecated

func (x *PrmObjectPutInit) WithEpochSource(es transformer.EpochSource)

WithEpochSource specifies epoch for object when split it on client side.

Deprecated: Use PrmObjectPutInit.EpochSource instead.

func (*PrmObjectPutInit) WithObjectMaxSize deprecated

func (x *PrmObjectPutInit) WithObjectMaxSize(maxSize uint64)

WithObjectMaxSize specifies max object size value and use it during object splitting. When specified, start writing to the stream only after the object is formed. Continue processing the input only when the previous formed object has been successfully written.

Deprecated: Use PrmObjectPutInit.MaxSize instead.

func (*PrmObjectPutInit) WithXHeaders deprecated

func (x *PrmObjectPutInit) 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.

Deprecated: Use PrmObjectPutInit.XHeaders instead.

func (*PrmObjectPutInit) WithinSession deprecated

func (x *PrmObjectPutInit) WithinSession(t session.Object)

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

Deprecated: Use PrmObjectPutInit.Session instead.

func (*PrmObjectPutInit) WithoutHomomorphicHash deprecated

func (x *PrmObjectPutInit) WithoutHomomorphicHash(v bool)

WithoutHomomorphicHash if set to true do not use Tillich-Zémor hash for payload.

Deprecated: Use PrmObjectPutInit.WithoutHomomorphHash instead.

type PrmObjectPutSingle

type PrmObjectPutSingle struct {
	XHeaders []string

	BearerToken *bearer.Token

	Session *session.Object

	Local bool

	CopiesNumber []uint32

	Object *object.Object

	Key *ecdsa.PrivateKey
}

PrmObjectPutSingle groups parameters of PutSingle operation.

func (*PrmObjectPutSingle) ExecuteLocal deprecated

func (prm *PrmObjectPutSingle) ExecuteLocal()

ExecuteLocal tells the server to execute the operation locally.

Deprecated: Use PrmObjectPutSingle.Local instead.

func (*PrmObjectPutSingle) SetCopiesNumber deprecated

func (prm *PrmObjectPutSingle) SetCopiesNumber(v []uint32)

SetCopiesNumber sets ordered list of minimal required object copies numbers per placement vector. List's length MUST equal container's placement vector number, otherwise request will fail.

Deprecated: Use PrmObjectPutSingle.CopiesNumber instead.

func (*PrmObjectPutSingle) SetObject deprecated

func (prm *PrmObjectPutSingle) SetObject(o *v2object.Object)

SetObject specifies prepared object to put.

Deprecated: Use PrmObjectPutSingle.Object instead.

func (*PrmObjectPutSingle) UseKey deprecated

func (prm *PrmObjectPutSingle) UseKey(key *ecdsa.PrivateKey)

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

Deprecated: Use PrmObjectPutSingle.Key instead.

func (*PrmObjectPutSingle) WithBearerToken deprecated

func (prm *PrmObjectPutSingle) WithBearerToken(t bearer.Token)

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

Deprecated: Use PrmObjectPutSingle.BearerToken instead.

func (*PrmObjectPutSingle) WithXHeaders deprecated

func (prm *PrmObjectPutSingle) 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.

Deprecated: Use PrmObjectPutSingle.XHeaders instead.

func (*PrmObjectPutSingle) WithinSession deprecated

func (prm *PrmObjectPutSingle) WithinSession(t session.Object)

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

Deprecated: Use PrmObjectPutSingle.Session instead.

type PrmObjectRange

type PrmObjectRange struct {
	XHeaders []string

	BearerToken *bearer.Token

	Session *session.Object

	Raw bool

	Local bool

	ContainerID *cid.ID

	ObjectID *oid.ID

	Key *ecdsa.PrivateKey

	Offset uint64

	Length uint64
}

PrmObjectRange groups parameters of ObjectRange operation.

func (*PrmObjectRange) UseKey deprecated

func (prm *PrmObjectRange) UseKey(key ecdsa.PrivateKey)

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

Deprecated: Use PrmObjectRange.Key instead.

type PrmObjectSearch

type PrmObjectSearch struct {
	XHeaders []string

	Local bool

	BearerToken *bearer.Token

	Session *session.Object

	ContainerID *cid.ID

	Key *ecdsa.PrivateKey

	Filters object.SearchFilters
}

PrmObjectSearch groups parameters of ObjectSearch operation.

func (*PrmObjectSearch) InContainer deprecated

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

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

Deprecated: Use PrmObjectSearch.ContainerID instead.

func (*PrmObjectSearch) MarkLocal deprecated

func (x *PrmObjectSearch) MarkLocal()

MarkLocal tells the server to execute the operation locally.

Deprecated: Use PrmObjectSearch.Local instead.

func (*PrmObjectSearch) SetFilters deprecated

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

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

Deprecated: Use PrmObjectSearch.Filters instead.

func (*PrmObjectSearch) UseKey deprecated

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

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

Deprecated: Use PrmObjectSearch.Key instead.

func (*PrmObjectSearch) WithBearerToken deprecated

func (x *PrmObjectSearch) WithBearerToken(t bearer.Token)

WithBearerToken attaches bearer token to be used for the operation.

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

Must be signed.

Deprecated: Use PrmObjectSearch.BearerToken instead.

func (*PrmObjectSearch) WithXHeaders deprecated

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.

Deprecated: Use PrmObjectSearch.XHeaders instead.

func (*PrmObjectSearch) WithinSession deprecated

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

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.

Deprecated: Use PrmObjectSearch.Session instead.

type PrmSessionCreate

type PrmSessionCreate struct {
	XHeaders []string

	Expiration uint64

	Key *ecdsa.PrivateKey
}

PrmSessionCreate groups parameters of SessionCreate operation.

func (*PrmSessionCreate) SetExp deprecated

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.

Deprecated: Use PrmSessionCreate.Expiration instead.

func (*PrmSessionCreate) UseKey deprecated

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

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

Deprecated: Use PrmSessionCreate.Key instead.

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 FrostFS account as decimal number.

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.

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).

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 FrostFS API protocol's version in use.

func (ResEndpointInfo) NodeInfo

func (x ResEndpointInfo) NodeInfo() netmap.NodeInfo

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

func (ResEndpointInfo) Status

func (x ResEndpointInfo) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

type ResNetMapSnapshot

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

ResNetMapSnapshot groups resulting values of NetMapSnapshot operation.

func (ResNetMapSnapshot) NetMap

func (x ResNetMapSnapshot) NetMap() netmap.NetMap

NetMap returns current server's local network map.

func (ResNetMapSnapshot) Status

func (x ResNetMapSnapshot) 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

Info returns structured information about the FrostFS network.

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) Status

func (x ResObjectDelete) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

func (ResObjectDelete) Tombstone

func (x ResObjectDelete) Tombstone() oid.ID

Tombstone returns identifier of the created tombstone object.

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) Status

func (x ResObjectPut) Status() apistatus.Status

Status returns server's status return.

Use apistatus package functionality to handle the status.

func (ResObjectPut) StoredObjectID

func (x ResObjectPut) StoredObjectID() oid.ID

StoredObjectID returns identifier of the saved object.

type ResObjectPutSingle

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

ResObjectPutSingle groups resulting values of PutSingle operation.

func (ResObjectPutSingle) Status

func (x ResObjectPutSingle) 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 FrostFS 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 FrostFS 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 FrostFS API response.

func (ResponseMetaInfo) Epoch

func (x ResponseMetaInfo) Epoch() uint64

Epoch returns local FrostFS epoch of the server.

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