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-sdk-go/api/rpc/client" import "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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 ¶
- func IsErrAPEManagerAccessDenied(err error) bool
- func IsErrContainerNotFound(err error) bool
- func IsErrEACLNotFound(err error) bool
- func IsErrNodeUnderMaintenance(err error) bool
- func IsErrObjectAlreadyRemoved(err error) bool
- func IsErrObjectNotFound(err error) bool
- func IsErrSessionExpired(err error) bool
- func IsErrSessionNotFound(err error) bool
- func SyncContainerWithNetwork(ctx context.Context, cnr *container.Container, c *Client) error
- type Client
- func (c *Client) APEManagerAddChain(ctx context.Context, prm PrmAPEManagerAddChain) (*ResAPEManagerAddChain, error)
- func (c *Client) APEManagerListChains(ctx context.Context, prm PrmAPEManagerListChains) (*ResAPEManagerListChains, error)
- func (c *Client) APEManagerRemoveChain(ctx context.Context, prm PrmAPEManagerRemoveChain) (*ResAPEManagerRemoveChain, error)
- func (c *Client) BalanceGet(ctx context.Context, prm PrmBalanceGet) (*ResBalanceGet, error)
- func (c *Client) Close() error
- func (c *Client) ContainerDelete(ctx context.Context, prm PrmContainerDelete) (*ResContainerDelete, error)
- func (c *Client) ContainerGet(ctx context.Context, prm PrmContainerGet) (*ResContainerGet, error)
- func (c *Client) ContainerList(ctx context.Context, prm PrmContainerList) (*ResContainerList, error)
- func (c *Client) ContainerListInit(ctx context.Context, prm PrmContainerListStream) (*ContainerListReader, error)
- func (c *Client) ContainerPut(ctx context.Context, prm PrmContainerPut) (*ResContainerPut, error)
- func (c *Client) Dial(ctx context.Context, prm PrmDial) error
- func (c *Client) EndpointInfo(ctx context.Context, prm PrmEndpointInfo) (*ResEndpointInfo, error)
- func (c *Client) ExecRaw(f func(client *client.Client) error) error
- func (c *Client) Init(prm PrmInit)
- func (c *Client) NetMapSnapshot(ctx context.Context, _ PrmNetMapSnapshot) (*ResNetMapSnapshot, error)
- func (c *Client) NetworkInfo(ctx context.Context, prm PrmNetworkInfo) (*ResNetworkInfo, error)
- func (c *Client) ObjectDelete(ctx context.Context, prm PrmObjectDelete) (*ResObjectDelete, error)
- func (c *Client) ObjectGetInit(ctx context.Context, prm PrmObjectGet) (*ObjectReader, error)
- func (c *Client) ObjectHash(ctx context.Context, prm PrmObjectHash) (*ResObjectHash, error)
- func (c *Client) ObjectHead(ctx context.Context, prm PrmObjectHead) (*ResObjectHead, error)
- func (c *Client) ObjectPatchInit(ctx context.Context, prm PrmObjectPatch) (ObjectPatcher, error)
- func (c *Client) ObjectPutInit(ctx context.Context, prm PrmObjectPutInit) (ObjectWriter, error)
- func (c *Client) ObjectPutSingle(ctx context.Context, prm PrmObjectPutSingle) (*ResObjectPutSingle, error)
- func (c *Client) ObjectRangeInit(ctx context.Context, prm PrmObjectRange) (*ObjectRangeReader, error)
- func (c *Client) ObjectSearchInit(ctx context.Context, prm PrmObjectSearch) (*ObjectListReader, error)
- func (c *Client) SessionCreate(ctx context.Context, prm PrmSessionCreate) (*ResSessionCreate, error)
- type ContainerListReader
- type ObjectListReader
- type ObjectPatcher
- type ObjectRangeReader
- type ObjectReader
- type ObjectWriter
- type PrmAPEManagerAddChain
- type PrmAPEManagerListChains
- type PrmAPEManagerRemoveChain
- type PrmBalanceGet
- type PrmContainerDelete
- type PrmContainerGet
- type PrmContainerList
- type PrmContainerListStream
- type PrmContainerPut
- type PrmDial
- func (x *PrmDial) SetGRPCDialOptions(opts ...grpc.DialOption)deprecated
- func (x *PrmDial) SetServerURI(endpoint string)deprecated
- func (x *PrmDial) SetStreamTimeout(timeout time.Duration)deprecated
- func (x *PrmDial) SetTLSConfig(tlsConfig *tls.Config)
- func (x *PrmDial) SetTimeout(timeout time.Duration)deprecated
- type PrmEndpointInfo
- type PrmInit
- type PrmNetMapSnapshot
- type PrmNetworkInfo
- type PrmObjectDelete
- type PrmObjectGet
- type PrmObjectHash
- type PrmObjectHead
- type PrmObjectPatch
- type PrmObjectPutInit
- func (x *PrmObjectPutInit) MarkLocal()deprecated
- func (x *PrmObjectPutInit) SetCopiesNumber(copiesNumber uint32)deprecated
- func (x *PrmObjectPutInit) SetCopiesNumberByVectors(copiesNumbers []uint32)deprecated
- func (x *PrmObjectPutInit) SetGRPCPayloadChunkLen(v int)deprecated
- func (x *PrmObjectPutInit) UseKey(key ecdsa.PrivateKey)deprecated
- func (x *PrmObjectPutInit) WithBearerToken(t bearer.Token)deprecated
- func (x *PrmObjectPutInit) WithEpochSource(es transformer.EpochSource)deprecated
- func (x *PrmObjectPutInit) WithObjectMaxSize(maxSize uint64)deprecated
- func (x *PrmObjectPutInit) WithXHeaders(hs ...string)deprecated
- func (x *PrmObjectPutInit) WithinSession(t session.Object)deprecated
- func (x *PrmObjectPutInit) WithoutHomomorphicHash(v bool)deprecated
- type PrmObjectPutSingle
- func (prm *PrmObjectPutSingle) ExecuteLocal()deprecated
- func (prm *PrmObjectPutSingle) SetCopiesNumber(v []uint32)deprecated
- func (prm *PrmObjectPutSingle) SetObject(o *v2object.Object)deprecated
- func (prm *PrmObjectPutSingle) UseKey(key *ecdsa.PrivateKey)deprecated
- func (prm *PrmObjectPutSingle) WithBearerToken(t bearer.Token)deprecated
- func (prm *PrmObjectPutSingle) WithXHeaders(hs ...string)deprecated
- func (prm *PrmObjectPutSingle) WithinSession(t session.Object)deprecated
- type PrmObjectRange
- type PrmObjectSearch
- func (x *PrmObjectSearch) InContainer(id cid.ID)deprecated
- func (x *PrmObjectSearch) MarkLocal()deprecated
- func (x *PrmObjectSearch) SetFilters(filters object.SearchFilters)deprecated
- func (x *PrmObjectSearch) UseKey(key ecdsa.PrivateKey)deprecated
- func (x *PrmObjectSearch) WithBearerToken(t bearer.Token)deprecated
- func (x *PrmObjectSearch) WithXHeaders(hs ...string)deprecated
- func (x *PrmObjectSearch) WithinSession(t session.Object)deprecated
- type PrmSessionCreate
- type ResAPEManagerAddChain
- type ResAPEManagerListChains
- type ResAPEManagerRemoveChain
- type ResBalanceGet
- type ResContainerDelete
- type ResContainerGet
- type ResContainerList
- type ResContainerListStream
- type ResContainerPut
- type ResEndpointInfo
- type ResNetMapSnapshot
- type ResNetworkInfo
- type ResObjectDelete
- type ResObjectGet
- type ResObjectHash
- type ResObjectHead
- type ResObjectPatch
- type ResObjectPut
- type ResObjectPutSingle
- type ResObjectRange
- type ResObjectSearch
- type ResSessionCreate
- type ResponseMetaInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsErrAPEManagerAccessDenied ¶
IsErrAPEManagerAccessDenied checks if err corresponds to FrostFS status return corresponding to apemanager access deny. Supports wrapped errors.
func IsErrContainerNotFound ¶
IsErrContainerNotFound checks if err corresponds to FrostFS status return corresponding to missing container. Supports wrapped errors.
func IsErrEACLNotFound ¶
IsErrEACLNotFound checks if err corresponds to FrostFS status return corresponding to missing eACL table. Supports wrapped errors.
func IsErrNodeUnderMaintenance ¶
IsErrNodeUnderMaintenance checks if err corresponds to FrostFS status return corresponding to nodes being under maintenance. Supports wrapped errors.
func IsErrObjectAlreadyRemoved ¶
IsErrObjectAlreadyRemoved checks if err corresponds to FrostFS status return corresponding to already removed object. Supports wrapped errors.
func IsErrObjectNotFound ¶
IsErrObjectNotFound checks if err corresponds to FrostFS status return corresponding to missing object. Supports wrapped errors.
func IsErrSessionExpired ¶
IsErrSessionExpired checks if err corresponds to FrostFS status return corresponding to expired session. Supports wrapped errors.
func IsErrSessionNotFound ¶
IsErrSessionNotFound checks if err corresponds to FrostFS status return corresponding to missing session. Supports wrapped errors.
func SyncContainerWithNetwork ¶
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) APEManagerAddChain ¶
func (c *Client) APEManagerAddChain(ctx context.Context, prm PrmAPEManagerAddChain) (*ResAPEManagerAddChain, error)
APEManagerAddChain sets Chain for ChainTarget.
func (*Client) APEManagerListChains ¶
func (c *Client) APEManagerListChains(ctx context.Context, prm PrmAPEManagerListChains) (*ResAPEManagerListChains, error)
APEManagerListChains lists Chains for ChainTarget.
func (*Client) APEManagerRemoveChain ¶
func (c *Client) APEManagerRemoveChain(ctx context.Context, prm PrmAPEManagerRemoveChain) (*ResAPEManagerRemoveChain, error)
APEManagerRemoveChain removes Chain with ChainID defined for ChainTarget.
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 ¶
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) 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) 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) ContainerListInit ¶
func (c *Client) ContainerListInit(ctx context.Context, prm PrmContainerListStream) (*ContainerListReader, error)
ContainerListInit initiates container selection through a remote server using FrostFS API protocol.
The call only opens the transmission channel, explicit fetching of identifiers of the account-owned containers is done using the ContainerListReader. Exactly one return value is non-nil. Resulting reader must be finally closed.
Returns an error if parameters are set incorrectly (see PrmContainerListStream docs). Context is required and must not be nil. It is used for network communication.
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) Dial ¶
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 ¶
ExecRaw executes f with underlying sdk-go/api/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-sdk-go/api/rpc/client package docs.
func (*Client) Init ¶
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). *object.ECInfoError (returned on erasure-coded objects with PrmObjectHead.MakeRaw).
Return statuses:
- global (see Client docs);
- *apistatus.ContainerNotFound;
- *apistatus.ObjectNotFound;
- *apistatus.ObjectAccessDenied;
- *apistatus.ObjectAlreadyRemoved;
- *apistatus.SessionTokenExpired.
func (*Client) ObjectPatchInit ¶
func (c *Client) ObjectPatchInit(ctx context.Context, prm PrmObjectPatch) (ObjectPatcher, error)
ObjectPatchInit initializes object patcher.
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 ContainerListReader ¶
type ContainerListReader struct {
// contains filtered or unexported fields
}
ContainerListReader is designed to read list of container identifiers from FrostFS system.
Must be initialized using Client.ContainerListInit, any other usage is unsafe.
func (*ContainerListReader) Close ¶
func (x *ContainerListReader) Close() (*ResContainerListStream, error)
Close ends reading list of the matched containers and returns the result of the operation along with the final results. Must be called after using the ContainerListReader.
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.
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 ObjectPatcher ¶
type ObjectPatcher interface { // PatchAttributes patches attributes. Attributes can be patched no more than once, // otherwise, the server returns an error. // // Result means success. Failure reason can be received via Close. PatchAttributes(ctx context.Context, newAttrs []object.Attribute, replace bool) bool // PatchPayload patches the object's payload. // // PatchPayload receives `payloadReader` and thus the payload of the patch is read and sent by chunks of // `MaxChunkLength` length. // // Result means success. Failure reason can be received via Close. PatchPayload(ctx context.Context, rng *object.Range, payloadReader io.Reader) bool // Close ends patching the object and returns the result of the operation // along with the final results. Must be called after using the ObjectPatcher. // // 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.ContainerAccessDenied; // - *apistatus.ObjectAccessDenied; // - *apistatus.ObjectAlreadyRemoved; // - *apistatus.ObjectLocked; // - *apistatus.ObjectOutOfRange; // - *apistatus.SessionTokenNotFound; // - *apistatus.SessionTokenExpired. Close(_ context.Context) (*ResObjectPatch, error) }
ObjectPatcher is designed to patch an object.
Must be initialized using Client.ObjectPatchInit, any other usage is unsafe.
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). *object.ECInfoError (returned on erasure-coded objects with PrmObjectRange.MakeRaw).
Return statuses:
- global (see Client docs);
- *apistatus.ContainerNotFound;
- *apistatus.ObjectNotFound;
- *apistatus.ObjectAccessDenied;
- *apistatus.ObjectAlreadyRemoved;
- *apistatus.ObjectOutOfRange;
- *apistatus.SessionTokenExpired.
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). *object.ECInfoError (returned on erasure-coded 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 PrmAPEManagerAddChain ¶
type PrmAPEManagerAddChain struct { XHeaders []string ChainTarget apeSDK.ChainTarget Chain apeSDK.Chain }
PrmAPEManagerAddChain groups parameters of APEManagerAddChain operation.
type PrmAPEManagerListChains ¶
type PrmAPEManagerListChains struct { XHeaders []string ChainTarget apeSDK.ChainTarget }
PrmAPEManagerListChains groups parameters of APEManagerListChains operation.
type PrmAPEManagerRemoveChain ¶
type PrmAPEManagerRemoveChain struct { XHeaders []string ChainTarget apeSDK.ChainTarget ChainID apeSDK.ChainID }
PrmAPEManagerRemoveChain groups parameters of APEManagerRemoveChain operation.
type PrmBalanceGet ¶
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 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 ¶
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.OwnerID instead.
type PrmContainerListStream ¶
PrmContainerListStream groups parameters of ContainerListStream operation.
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 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 (*PrmDial) SetStreamTimeout
deprecated
func (*PrmDial) SetTLSConfig ¶
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
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 PrmObjectPatch ¶
type PrmObjectPatch struct { XHeaders []string Address oid.Address BearerToken *bearer.Token Session *session.Object Key *ecdsa.PrivateKey MaxChunkLength int }
PrmObjectPatch groups parameters of ObjectPatch operation.
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 ResAPEManagerAddChain ¶
type ResAPEManagerListChains ¶
type ResAPEManagerRemoveChain ¶
type ResAPEManagerRemoveChain struct {
// contains filtered or unexported fields
}
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.
type ResContainerDelete ¶
type ResContainerDelete struct {
// contains filtered or unexported fields
}
ResContainerDelete groups resulting values of ContainerDelete operation.
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.
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.
type ResContainerListStream ¶
type ResContainerListStream struct {
// contains filtered or unexported fields
}
ResContainerListStream groups the final result values of ContainerListStream operation.
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).
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.
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.
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 FrostFS network.
type ResObjectDelete ¶
type ResObjectDelete struct {
// contains filtered or unexported fields
}
ResObjectDelete groups resulting values of ObjectDelete operation.
func (ResObjectDelete) 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.
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.
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).
type ResObjectPatch ¶
type ResObjectPatch struct {
// contains filtered or unexported fields
}
ResObjectPatch groups resulting values of ObjectPatch operation.
func (ResObjectPatch) ObjectID ¶
func (r ResObjectPatch) ObjectID() oid.ID
ObjectID returns an object ID of the patched object.
type ResObjectPut ¶
type ResObjectPut struct {
// contains filtered or unexported fields
}
ResObjectPut groups the final result values of ObjectPutInit operation.
func (ResObjectPut) Status ¶
Status returns server's status return.
Use apistatus package functionality to handle the status.
func (ResObjectPut) StoredEpoch ¶
func (x ResObjectPut) StoredEpoch() uint64
StoredEpoch returns creation epoch of the saved object.
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) Epoch ¶
func (r *ResObjectPutSingle) Epoch() uint64
Epoch returns creation epoch of the saved object.
type ResObjectRange ¶
type ResObjectRange struct {
// contains filtered or unexported fields
}
ResObjectRange groups the final result values of ObjectRange operation.
type ResObjectSearch ¶
type ResObjectSearch struct {
// contains filtered or unexported fields
}
ResObjectSearch groups the final result values of ObjectSearch operation.
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.
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.
Source Files ¶
- accounting.go
- apemanager_add_chain.go
- apemanager_list_chains.go
- apemanager_remove_chain.go
- api.go
- client.go
- common.go
- container.go
- container_delete.go
- container_get.go
- container_list.go
- container_list_stream.go
- container_put.go
- doc.go
- errors.go
- netmap.go
- object_delete.go
- object_get.go
- object_hash.go
- object_patch.go
- object_put.go
- object_put_raw.go
- object_put_single.go
- object_put_transformer.go
- object_search.go
- response.go
- session.go