Documentation
¶
Index ¶
- Constants
- func DeleteObject(ctx context.Context, c *Client, p *DeleteObjectParams, opts ...CallOption) (*object.Address, error)
- func GetVerifiedContainerStructure(ctx context.Context, c *Client, id *container.ID, opts ...CallOption) (*container.Container, error)
- type CallOption
- type Client
- func (c *Client) AttachBearerToken(token *token.BearerToken)
- func (c *Client) AttachSessionToken(token *token.SessionToken)
- func (c Client) CreateSession(ctx context.Context, expiration uint64, opts ...CallOption) (*token.SessionToken, error)
- func (c Client) DeleteContainer(ctx context.Context, id *container.ID, opts ...CallOption) error
- func (c *Client) DeleteObject(ctx context.Context, p *DeleteObjectParams, opts ...CallOption) error
- func (c Client) EndpointInfo(ctx context.Context, opts ...CallOption) (*netmap.NodeInfo, error)
- func (c Client) Epoch(ctx context.Context, opts ...CallOption) (uint64, error)
- func (c Client) GetBalance(ctx context.Context, owner *owner.ID, opts ...CallOption) (*accounting.Decimal, error)
- func (c Client) GetContainer(ctx context.Context, id *container.ID, opts ...CallOption) (*container.Container, error)
- func (c Client) GetEACL(ctx context.Context, id *container.ID, opts ...CallOption) (*eacl.Table, error)
- func (c Client) GetEACLWithSignature(ctx context.Context, id *container.ID, opts ...CallOption) (*EACLWithSignature, error)
- func (c *Client) GetObject(ctx context.Context, p *GetObjectParams, opts ...CallOption) (*object.Object, error)
- func (c *Client) GetObjectHeader(ctx context.Context, p *ObjectHeaderParams, opts ...CallOption) (*object.Object, error)
- func (c Client) GetSelfBalance(ctx context.Context, opts ...CallOption) (*accounting.Decimal, error)
- func (c Client) ListContainers(ctx context.Context, owner *owner.ID, opts ...CallOption) ([]*container.ID, error)
- func (c Client) ListSelfContainers(ctx context.Context, opts ...CallOption) ([]*container.ID, error)
- func (c *Client) ObjectPayloadRangeData(ctx context.Context, p *RangeDataParams, opts ...CallOption) ([]byte, error)
- func (c *Client) ObjectPayloadRangeSHA256(ctx context.Context, p *RangeChecksumParams, opts ...CallOption) ([][sha256.Size]byte, error)
- func (c *Client) ObjectPayloadRangeTZ(ctx context.Context, p *RangeChecksumParams, opts ...CallOption) ([][TZSize]byte, error)
- func (c Client) PutContainer(ctx context.Context, cnr *container.Container, opts ...CallOption) (*container.ID, error)
- func (c *Client) PutObject(ctx context.Context, p *PutObjectParams, opts ...CallOption) (*object.ID, error)
- func (c *Client) SearchObject(ctx context.Context, p *SearchObjectParams, opts ...CallOption) ([]*object.ID, error)
- func (c Client) SetEACL(ctx context.Context, eacl *eacl.Table, opts ...CallOption) error
- type DeleteObjectParams
- func (p *DeleteObjectParams) Address() *object.Address
- func (p *DeleteObjectParams) TombstoneAddressTarget() ObjectAddressWriter
- func (p *DeleteObjectParams) WithAddress(v *object.Address) *DeleteObjectParams
- func (p *DeleteObjectParams) WithTombstoneAddressTarget(v ObjectAddressWriter) *DeleteObjectParams
- type EACLWithSignature
- type GetObjectParams
- func (p *GetObjectParams) Address() *object.Address
- func (p *GetObjectParams) PayloadWriter() io.Writer
- func (p *GetObjectParams) RawFlag() bool
- func (p *GetObjectParams) WithAddress(v *object.Address) *GetObjectParams
- func (p *GetObjectParams) WithPayloadWriter(w io.Writer) *GetObjectParams
- func (p *GetObjectParams) WithRawFlag(v bool) *GetObjectParams
- type ObjectAddressWriter
- type ObjectHeaderParams
- func (p *ObjectHeaderParams) Address() *object.Address
- func (p *ObjectHeaderParams) AllFields() bool
- func (p *ObjectHeaderParams) RawFlag() bool
- func (p *ObjectHeaderParams) WithAddress(v *object.Address) *ObjectHeaderParams
- func (p *ObjectHeaderParams) WithAllFields() *ObjectHeaderParams
- func (p *ObjectHeaderParams) WithMainFields() *ObjectHeaderParams
- func (p *ObjectHeaderParams) WithRawFlag(v bool) *ObjectHeaderParams
- type Option
- type PutObjectParams
- type RangeChecksumParams
- func (p *RangeChecksumParams) Address() *object.Address
- func (p *RangeChecksumParams) RangeList() []*object.Range
- func (p *RangeChecksumParams) Salt() []byte
- func (p *RangeChecksumParams) WithAddress(v *object.Address) *RangeChecksumParams
- func (p *RangeChecksumParams) WithRangeList(rs ...*object.Range) *RangeChecksumParams
- func (p *RangeChecksumParams) WithSalt(v []byte) *RangeChecksumParams
- type RangeDataParams
- func (p *RangeDataParams) Address() *object.Address
- func (p *RangeDataParams) DataWriter() io.Writer
- func (p *RangeDataParams) Range() *object.Range
- func (p *RangeDataParams) Raw() bool
- func (p *RangeDataParams) WithAddress(v *object.Address) *RangeDataParams
- func (p *RangeDataParams) WithDataWriter(v io.Writer) *RangeDataParams
- func (p *RangeDataParams) WithRange(v *object.Range) *RangeDataParams
- func (p *RangeDataParams) WithRaw(v bool) *RangeDataParams
- type SearchObjectParams
- type TransportInfo
- type TransportProtocol
Constants ¶
const TZSize = 64
Variables ¶
This section is empty.
Functions ¶
func DeleteObject ¶ added in v1.21.0
func DeleteObject(ctx context.Context, c *Client, p *DeleteObjectParams, opts ...CallOption) (*object.Address, error)
DeleteObject is a wrapper over Client.DeleteObject method that provides the ability to receive tombstone address without setting a target in the parameters.
func GetVerifiedContainerStructure ¶ added in v1.21.1
func GetVerifiedContainerStructure(ctx context.Context, c *Client, id *container.ID, opts ...CallOption) (*container.Container, error)
GetVerifiedContainerStructure is a wrapper over Client.GetContainer method which checks if the structure of the resulting container matches its identifier.
Returns container.ErrIDMismatch if container does not match the identifier.
Types ¶
type CallOption ¶
type CallOption interface {
// contains filtered or unexported methods
}
func WithBearer ¶
func WithBearer(token *token.BearerToken) CallOption
func WithEpoch ¶
func WithEpoch(epoch uint64) CallOption
func WithSession ¶
func WithSession(token *token.SessionToken) CallOption
func WithTTL ¶
func WithTTL(ttl uint32) CallOption
func WithXHeader ¶
func WithXHeader(x *pkg.XHeader) CallOption
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AttachBearerToken ¶
func (c *Client) AttachBearerToken(token *token.BearerToken)
AttachBearerToken attaches bearer token to client.
Provided bearer is attached to all requests without WithBearer option. Use WithBearer(nil) option in order to send request without bearer token.
func (*Client) AttachSessionToken ¶
func (c *Client) AttachSessionToken(token *token.SessionToken)
AttachSessionToken attaches session token to client.
Provided token is attached to all requests without WithSession option. Use WithSession(nil) option in order to send request without session token.
func (Client) CreateSession ¶
func (c Client) CreateSession(ctx context.Context, expiration uint64, opts ...CallOption) (*token.SessionToken, error)
func (Client) DeleteContainer ¶
func (*Client) DeleteObject ¶
func (c *Client) DeleteObject(ctx context.Context, p *DeleteObjectParams, opts ...CallOption) error
DeleteObject removes object by address.
If target of tombstone address is not set, the address is ignored.
func (Client) EndpointInfo ¶
EndpointInfo returns attributes, address and public key of the node, specified in client constructor via address or open connection. This can be used as a health check to see if node is alive and responses to requests.
func (Client) GetBalance ¶
func (c Client) GetBalance(ctx context.Context, owner *owner.ID, opts ...CallOption) (*accounting.Decimal, error)
func (Client) GetContainer ¶
func (c Client) GetContainer(ctx context.Context, id *container.ID, opts ...CallOption) (*container.Container, error)
GetContainer receives container structure through NeoFS API call.
Returns error if container structure is received but does not meet NeoFS API specification.
func (Client) GetEACLWithSignature ¶ added in v1.20.3
func (c Client) GetEACLWithSignature(ctx context.Context, id *container.ID, opts ...CallOption) (*EACLWithSignature, error)
func (*Client) GetObject ¶
func (c *Client) GetObject(ctx context.Context, p *GetObjectParams, opts ...CallOption) (*object.Object, error)
func (*Client) GetObjectHeader ¶
func (c *Client) GetObjectHeader(ctx context.Context, p *ObjectHeaderParams, opts ...CallOption) (*object.Object, error)
func (Client) GetSelfBalance ¶
func (c Client) GetSelfBalance(ctx context.Context, opts ...CallOption) (*accounting.Decimal, error)
func (Client) ListContainers ¶
func (Client) ListSelfContainers ¶
func (*Client) ObjectPayloadRangeData ¶
func (c *Client) ObjectPayloadRangeData(ctx context.Context, p *RangeDataParams, opts ...CallOption) ([]byte, error)
func (*Client) ObjectPayloadRangeSHA256 ¶
func (c *Client) ObjectPayloadRangeSHA256(ctx context.Context, p *RangeChecksumParams, opts ...CallOption) ([][sha256.Size]byte, error)
func (*Client) ObjectPayloadRangeTZ ¶
func (c *Client) ObjectPayloadRangeTZ(ctx context.Context, p *RangeChecksumParams, opts ...CallOption) ([][TZSize]byte, error)
func (Client) PutContainer ¶
func (*Client) PutObject ¶
func (c *Client) PutObject(ctx context.Context, p *PutObjectParams, opts ...CallOption) (*object.ID, error)
func (*Client) SearchObject ¶
func (c *Client) SearchObject(ctx context.Context, p *SearchObjectParams, opts ...CallOption) ([]*object.ID, error)
type DeleteObjectParams ¶
type DeleteObjectParams struct {
// contains filtered or unexported fields
}
func (*DeleteObjectParams) Address ¶ added in v1.21.0
func (p *DeleteObjectParams) Address() *object.Address
func (*DeleteObjectParams) TombstoneAddressTarget ¶ added in v1.21.0
func (p *DeleteObjectParams) TombstoneAddressTarget() ObjectAddressWriter
TombstoneAddressTarget returns target component to write tombstone address.
func (*DeleteObjectParams) WithAddress ¶
func (p *DeleteObjectParams) WithAddress(v *object.Address) *DeleteObjectParams
func (*DeleteObjectParams) WithTombstoneAddressTarget ¶ added in v1.21.0
func (p *DeleteObjectParams) WithTombstoneAddressTarget(v ObjectAddressWriter) *DeleteObjectParams
WithTombstoneAddressTarget sets target component to write tombstone address.
type EACLWithSignature ¶ added in v1.20.3
type EACLWithSignature struct {
// contains filtered or unexported fields
}
EACLWithSignature represents eACL table/signature pair.
func (EACLWithSignature) EACL ¶ added in v1.20.3
func (e EACLWithSignature) EACL() *eacl.Table
EACL returns eACL table.
func (EACLWithSignature) Signature ¶ added in v1.20.3
func (e EACLWithSignature) Signature() *pkg.Signature
Signature returns table signature.
type GetObjectParams ¶
type GetObjectParams struct {
// contains filtered or unexported fields
}
func (*GetObjectParams) Address ¶ added in v1.21.0
func (p *GetObjectParams) Address() *object.Address
func (*GetObjectParams) PayloadWriter ¶ added in v1.21.0
func (p *GetObjectParams) PayloadWriter() io.Writer
func (*GetObjectParams) RawFlag ¶ added in v1.21.0
func (p *GetObjectParams) RawFlag() bool
func (*GetObjectParams) WithAddress ¶
func (p *GetObjectParams) WithAddress(v *object.Address) *GetObjectParams
func (*GetObjectParams) WithPayloadWriter ¶
func (p *GetObjectParams) WithPayloadWriter(w io.Writer) *GetObjectParams
func (*GetObjectParams) WithRawFlag ¶ added in v1.21.0
func (p *GetObjectParams) WithRawFlag(v bool) *GetObjectParams
type ObjectAddressWriter ¶ added in v1.21.0
ObjectAddressWriter is an interface of the component that writes the object address.
type ObjectHeaderParams ¶
type ObjectHeaderParams struct {
// contains filtered or unexported fields
}
func (*ObjectHeaderParams) Address ¶ added in v1.21.0
func (p *ObjectHeaderParams) Address() *object.Address
func (*ObjectHeaderParams) AllFields ¶ added in v1.21.0
func (p *ObjectHeaderParams) AllFields() bool
AllFields return true if parameter set to return all header fields, returns false if parameter set to return only main fields of header.
func (*ObjectHeaderParams) RawFlag ¶ added in v1.21.0
func (p *ObjectHeaderParams) RawFlag() bool
func (*ObjectHeaderParams) WithAddress ¶
func (p *ObjectHeaderParams) WithAddress(v *object.Address) *ObjectHeaderParams
func (*ObjectHeaderParams) WithAllFields ¶
func (p *ObjectHeaderParams) WithAllFields() *ObjectHeaderParams
func (*ObjectHeaderParams) WithMainFields ¶
func (p *ObjectHeaderParams) WithMainFields() *ObjectHeaderParams
func (*ObjectHeaderParams) WithRawFlag ¶ added in v1.21.0
func (p *ObjectHeaderParams) WithRawFlag(v bool) *ObjectHeaderParams
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithAddress ¶
func WithDialTimeout ¶ added in v1.20.3
WithDialTimeout returns option to set connection timeout to the remote node.
func WithGRPCConnection ¶
func WithGRPCConnection(grpcConn *grpc.ClientConn) Option
type PutObjectParams ¶
type PutObjectParams struct {
// contains filtered or unexported fields
}
func (*PutObjectParams) Object ¶ added in v1.21.0
func (p *PutObjectParams) Object() *object.Object
func (*PutObjectParams) PayloadReader ¶ added in v1.21.0
func (p *PutObjectParams) PayloadReader() io.Reader
func (*PutObjectParams) WithObject ¶
func (p *PutObjectParams) WithObject(v *object.Object) *PutObjectParams
func (*PutObjectParams) WithPayloadReader ¶
func (p *PutObjectParams) WithPayloadReader(v io.Reader) *PutObjectParams
type RangeChecksumParams ¶
type RangeChecksumParams struct {
// contains filtered or unexported fields
}
func (*RangeChecksumParams) Address ¶ added in v1.21.0
func (p *RangeChecksumParams) Address() *object.Address
func (*RangeChecksumParams) RangeList ¶ added in v1.21.0
func (p *RangeChecksumParams) RangeList() []*object.Range
func (*RangeChecksumParams) Salt ¶ added in v1.21.0
func (p *RangeChecksumParams) Salt() []byte
func (*RangeChecksumParams) WithAddress ¶
func (p *RangeChecksumParams) WithAddress(v *object.Address) *RangeChecksumParams
func (*RangeChecksumParams) WithRangeList ¶
func (p *RangeChecksumParams) WithRangeList(rs ...*object.Range) *RangeChecksumParams
func (*RangeChecksumParams) WithSalt ¶
func (p *RangeChecksumParams) WithSalt(v []byte) *RangeChecksumParams
type RangeDataParams ¶
type RangeDataParams struct {
// contains filtered or unexported fields
}
func (*RangeDataParams) Address ¶ added in v1.21.0
func (p *RangeDataParams) Address() *object.Address
func (*RangeDataParams) DataWriter ¶ added in v1.21.0
func (p *RangeDataParams) DataWriter() io.Writer
func (*RangeDataParams) Range ¶ added in v1.21.0
func (p *RangeDataParams) Range() *object.Range
func (*RangeDataParams) Raw ¶ added in v1.21.0
func (p *RangeDataParams) Raw() bool
func (*RangeDataParams) WithAddress ¶
func (p *RangeDataParams) WithAddress(v *object.Address) *RangeDataParams
func (*RangeDataParams) WithDataWriter ¶
func (p *RangeDataParams) WithDataWriter(v io.Writer) *RangeDataParams
func (*RangeDataParams) WithRange ¶
func (p *RangeDataParams) WithRange(v *object.Range) *RangeDataParams
func (*RangeDataParams) WithRaw ¶ added in v1.21.0
func (p *RangeDataParams) WithRaw(v bool) *RangeDataParams
type SearchObjectParams ¶
type SearchObjectParams struct {
// contains filtered or unexported fields
}
func (*SearchObjectParams) ContainerID ¶ added in v1.21.0
func (p *SearchObjectParams) ContainerID() *container.ID
func (*SearchObjectParams) SearchFilters ¶ added in v1.21.0
func (p *SearchObjectParams) SearchFilters() object.SearchFilters
func (*SearchObjectParams) WithContainerID ¶
func (p *SearchObjectParams) WithContainerID(v *container.ID) *SearchObjectParams
func (*SearchObjectParams) WithSearchFilters ¶
func (p *SearchObjectParams) WithSearchFilters(v object.SearchFilters) *SearchObjectParams
type TransportInfo ¶
type TransportInfo struct { Version *pkg.Version Protocol TransportProtocol }
type TransportProtocol ¶
type TransportProtocol uint32
const ( Unknown TransportProtocol = iota GRPC )