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 *cid.ID, opts ...CallOption) (*container.Container, error)
- type AnnounceIntermediateTrustPrm
- func (x *AnnounceIntermediateTrustPrm) Epoch() uint64
- func (x AnnounceIntermediateTrustPrm) Iteration() uint32
- func (x *AnnounceIntermediateTrustPrm) SetEpoch(epoch uint64)
- func (x *AnnounceIntermediateTrustPrm) SetIteration(iter uint32)
- func (x *AnnounceIntermediateTrustPrm) SetTrust(trust *reputation.PeerToPeerTrust)
- func (x AnnounceIntermediateTrustPrm) Trust() *reputation.PeerToPeerTrust
- type AnnounceIntermediateTrustRes
- type AnnounceLocalTrustPrm
- type AnnounceLocalTrustRes
- type CallOption
- type Client
- func (x Client) AnnounceContainerUsedSpace(ctx context.Context, announce []container.UsedSpaceAnnouncement, ...) error
- func (x Client) AnnounceIntermediateTrust(ctx context.Context, prm AnnounceIntermediateTrustPrm, opts ...CallOption) (*AnnounceIntermediateTrustRes, error)
- func (x Client) AnnounceLocalTrust(ctx context.Context, prm AnnounceLocalTrustPrm, opts ...CallOption) (*AnnounceLocalTrustRes, error)
- func (x Client) Close() error
- func (x Client) CreateSession(ctx context.Context, expiration uint64, opts ...CallOption) (*session.Token, error)
- func (x Client) DeleteContainer(ctx context.Context, id *cid.ID, opts ...CallOption) error
- func (x Client) DeleteObject(ctx context.Context, p *DeleteObjectParams, opts ...CallOption) error
- func (x Client) EndpointInfo(ctx context.Context, opts ...CallOption) (*EndpointInfo, error)
- func (x Client) GetBalance(ctx context.Context, owner *owner.ID, opts ...CallOption) (*accounting.Decimal, error)
- func (x Client) GetContainer(ctx context.Context, id *cid.ID, opts ...CallOption) (*container.Container, error)
- func (x Client) GetEACL(ctx context.Context, id *cid.ID, opts ...CallOption) (*EACLWithSignature, error)
- func (x Client) GetObject(ctx context.Context, p *GetObjectParams, opts ...CallOption) (*object.Object, error)
- func (x Client) GetObjectHeader(ctx context.Context, p *ObjectHeaderParams, opts ...CallOption) (*object.Object, error)
- func (x Client) ListContainers(ctx context.Context, ownerID *owner.ID, opts ...CallOption) ([]*cid.ID, error)
- func (x Client) NetworkInfo(ctx context.Context, opts ...CallOption) (*netmap.NetworkInfo, error)
- func (x Client) ObjectPayloadRangeData(ctx context.Context, p *RangeDataParams, opts ...CallOption) ([]byte, error)
- func (x Client) ObjectPayloadRangeSHA256(ctx context.Context, p *RangeChecksumParams, opts ...CallOption) ([][sha256.Size]byte, error)
- func (x Client) ObjectPayloadRangeTZ(ctx context.Context, p *RangeChecksumParams, opts ...CallOption) ([][TZSize]byte, error)
- func (x Client) PutContainer(ctx context.Context, cnr *container.Container, opts ...CallOption) (*cid.ID, error)
- func (x Client) PutObject(ctx context.Context, p *PutObjectParams, opts ...CallOption) (*object.ID, error)
- func (x Client) SearchObject(ctx context.Context, p *SearchObjectParams, opts ...CallOption) ([]*object.ID, error)
- func (x Client) SetEACL(ctx context.Context, eacl *eacl.Table, opts ...CallOption) error
- func (x *Client) SetProtoClient(c protoclient.Client)
- 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 DialPrm
- type DialRes
- type EACLWithSignature
- type EndpointInfo
- 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) WithPayloadReaderHandler(f ReaderHandler) *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 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 ReaderHandler
- type SearchObjectParams
- type Session
Constants ¶
const TZSize = 64
Variables ¶
This section is empty.
Functions ¶
func DeleteObject ¶
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 ¶
func GetVerifiedContainerStructure(ctx context.Context, c Client, id *cid.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 an error if container does not match the identifier.
Types ¶
type AnnounceIntermediateTrustPrm ¶
type AnnounceIntermediateTrustPrm struct {
// contains filtered or unexported fields
}
AnnounceIntermediateTrustPrm groups parameters of AnnounceIntermediateTrust operation.
func (*AnnounceIntermediateTrustPrm) Epoch ¶
func (x *AnnounceIntermediateTrustPrm) Epoch() uint64
func (AnnounceIntermediateTrustPrm) Iteration ¶
func (x AnnounceIntermediateTrustPrm) Iteration() uint32
Iteration returns sequence number of the iteration.
func (*AnnounceIntermediateTrustPrm) SetEpoch ¶
func (x *AnnounceIntermediateTrustPrm) SetEpoch(epoch uint64)
func (*AnnounceIntermediateTrustPrm) SetIteration ¶
func (x *AnnounceIntermediateTrustPrm) SetIteration(iter uint32)
SetIteration sets sequence number of the iteration.
func (*AnnounceIntermediateTrustPrm) SetTrust ¶
func (x *AnnounceIntermediateTrustPrm) SetTrust(trust *reputation.PeerToPeerTrust)
SetTrust sets current global trust value computed at the specified iteration.
func (AnnounceIntermediateTrustPrm) Trust ¶
func (x AnnounceIntermediateTrustPrm) Trust() *reputation.PeerToPeerTrust
Trust returns current global trust value computed at the specified iteration.
type AnnounceIntermediateTrustRes ¶
type AnnounceIntermediateTrustRes struct{}
AnnounceIntermediateTrustRes groups results of AnnounceIntermediateTrust operation.
type AnnounceLocalTrustPrm ¶
type AnnounceLocalTrustPrm struct {
// contains filtered or unexported fields
}
AnnounceLocalTrustPrm groups parameters of AnnounceLocalTrust operation.
func (AnnounceLocalTrustPrm) Epoch ¶
func (x AnnounceLocalTrustPrm) Epoch() uint64
Epoch returns epoch in which the trust was assessed.
func (*AnnounceLocalTrustPrm) SetEpoch ¶
func (x *AnnounceLocalTrustPrm) SetEpoch(epoch uint64)
SetEpoch sets epoch in which the trust was assessed.
func (*AnnounceLocalTrustPrm) SetTrusts ¶
func (x *AnnounceLocalTrustPrm) SetTrusts(trusts []*reputation.Trust)
SetTrusts sets list of local trust values.
func (AnnounceLocalTrustPrm) Trusts ¶
func (x AnnounceLocalTrustPrm) Trusts() []*reputation.Trust
Trusts returns list of local trust values.
type AnnounceLocalTrustRes ¶
type AnnounceLocalTrustRes struct{}
AnnounceLocalTrustRes groups results of AnnounceLocalTrust operation.
type CallOption ¶
type CallOption func(*callOptions)
func WithBearer ¶
func WithBearer(token *token.BearerToken) CallOption
func WithECDSAKey ¶
func WithECDSAKey(key ecdsa.PrivateKey) CallOption
WithECDSAKey sets client's ECDSA key for the next request.
func WithEpoch ¶
func WithEpoch(epoch uint64) CallOption
func WithSession ¶
func WithSession(token *session.Token) 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
}
Client represents NeoFS API client. It is a wrapper over protoclient.Client.
Should be initialized using DialPrm.Dial or SetProtoClient method.
Client is one-time use, and should only be used within an open connection.
func (Client) AnnounceContainerUsedSpace ¶
func (x Client) AnnounceContainerUsedSpace( ctx context.Context, announce []container.UsedSpaceAnnouncement, opts ...CallOption) error
AnnounceContainerUsedSpace used by storage nodes to estimate their container sizes during lifetime. Use it only in storage node applications.
func (Client) AnnounceIntermediateTrust ¶
func (x Client) AnnounceIntermediateTrust(ctx context.Context, prm AnnounceIntermediateTrustPrm, opts ...CallOption) (*AnnounceIntermediateTrustRes, error)
func (Client) AnnounceLocalTrust ¶
func (x Client) AnnounceLocalTrust(ctx context.Context, prm AnnounceLocalTrustPrm, opts ...CallOption) (*AnnounceLocalTrustRes, error)
func (Client) Close ¶
Close closes opened connection.
Must be called only after successful initialization.
func (Client) CreateSession ¶
func (Client) DeleteContainer ¶
func (Client) DeleteObject ¶
func (x 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 ¶
func (x Client) EndpointInfo(ctx context.Context, opts ...CallOption) (*EndpointInfo, error)
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 (x Client) GetBalance(ctx context.Context, owner *owner.ID, opts ...CallOption) (*accounting.Decimal, error)
func (Client) GetContainer ¶
func (x Client) GetContainer(ctx context.Context, id *cid.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) GetEACL ¶
func (x Client) GetEACL(ctx context.Context, id *cid.ID, opts ...CallOption) (*EACLWithSignature, error)
func (Client) GetObject ¶
func (x Client) GetObject(ctx context.Context, p *GetObjectParams, opts ...CallOption) (*object.Object, error)
func (Client) GetObjectHeader ¶
func (x Client) GetObjectHeader(ctx context.Context, p *ObjectHeaderParams, opts ...CallOption) (*object.Object, error)
func (Client) ListContainers ¶
func (Client) NetworkInfo ¶
func (x Client) NetworkInfo(ctx context.Context, opts ...CallOption) (*netmap.NetworkInfo, error)
NetworkInfo returns information about the NeoFS network of which the remote server is a part.
func (Client) ObjectPayloadRangeData ¶
func (x Client) ObjectPayloadRangeData(ctx context.Context, p *RangeDataParams, opts ...CallOption) ([]byte, error)
func (Client) ObjectPayloadRangeSHA256 ¶
func (x Client) ObjectPayloadRangeSHA256(ctx context.Context, p *RangeChecksumParams, opts ...CallOption) ([][sha256.Size]byte, error)
func (Client) ObjectPayloadRangeTZ ¶
func (x Client) ObjectPayloadRangeTZ(ctx context.Context, p *RangeChecksumParams, opts ...CallOption) ([][TZSize]byte, error)
func (Client) PutContainer ¶
func (Client) PutObject ¶
func (x Client) PutObject(ctx context.Context, p *PutObjectParams, opts ...CallOption) (*object.ID, error)
func (Client) SearchObject ¶
func (x Client) SearchObject(ctx context.Context, p *SearchObjectParams, opts ...CallOption) ([]*object.ID, error)
func (*Client) SetProtoClient ¶
func (x *Client) SetProtoClient(c protoclient.Client)
SetProtoClient sets underlying protoclient.Client.
type DeleteObjectParams ¶
type DeleteObjectParams struct {
// contains filtered or unexported fields
}
func (*DeleteObjectParams) Address ¶
func (p *DeleteObjectParams) Address() *object.Address
func (*DeleteObjectParams) TombstoneAddressTarget ¶
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 ¶
func (p *DeleteObjectParams) WithTombstoneAddressTarget(v ObjectAddressWriter) *DeleteObjectParams
WithTombstoneAddressTarget sets target component to write tombstone address.
type DialPrm ¶
type DialPrm struct {
// contains filtered or unexported fields
}
DialPrm groups the Dial parameters.
func (DialPrm) Dial ¶
Dial opens client connection and initializes Client with it.
Blocks until successful connection or timeout. If TLS is configured, connection is opened using it.
DialRes must not be nil. Client can be received using res.Client().
func (*DialPrm) SetAddress ¶
SetTCPAddress sets network address as a connection target.
func (*DialPrm) SetTLSConfig ¶
SetTLSConfig sets TLS client configuration.
func (*DialPrm) SetTimeout ¶
SetTimeout sets timeout for dialing.
func (*DialPrm) SetURIAddress ¶
SetURIAddress tries to parse URI from string and pass host to prm.SetAddress. Also updates TLS config. Returns true if prm is modified.
If address is not a valid URI, returns false.
Format of the URI:
[scheme://]host:port
Supported schemes:
- grpc;
- grpcs.
If scheme is not supported, returns false. If URI has grpcs scheme, empty TLS config is used.
Should not be used with SetAddress and SetTLSConfig if result is true.
type DialRes ¶
type DialRes struct {
// contains filtered or unexported fields
}
DialPrm groups the Dial results.
type EACLWithSignature ¶
type EACLWithSignature struct {
// contains filtered or unexported fields
}
EACLWithSignature represents eACL table/signature pair.
func (EACLWithSignature) EACL ¶
func (e EACLWithSignature) EACL() *eacl.Table
EACL returns eACL table.
func (EACLWithSignature) Signature
deprecated
func (e EACLWithSignature) Signature() *pkg.Signature
Signature returns table signature.
Deprecated: use EACL().Signature() instead.
type EndpointInfo ¶
type EndpointInfo struct {
// contains filtered or unexported fields
}
EACLWithSignature represents eACL table/signature pair.
func (*EndpointInfo) LatestVersion ¶
func (e *EndpointInfo) LatestVersion() *pkg.Version
LatestVersion returns latest NeoFS API version in use.
func (*EndpointInfo) NodeInfo ¶
func (e *EndpointInfo) NodeInfo() *netmap.NodeInfo
NodeInfo returns returns information about the NeoFS node.
type GetObjectParams ¶
type GetObjectParams struct {
// contains filtered or unexported fields
}
func (*GetObjectParams) Address ¶
func (p *GetObjectParams) Address() *object.Address
func (*GetObjectParams) PayloadWriter ¶
func (p *GetObjectParams) PayloadWriter() io.Writer
func (*GetObjectParams) RawFlag ¶
func (p *GetObjectParams) RawFlag() bool
func (*GetObjectParams) WithAddress ¶
func (p *GetObjectParams) WithAddress(v *object.Address) *GetObjectParams
func (*GetObjectParams) WithPayloadReaderHandler ¶
func (p *GetObjectParams) WithPayloadReaderHandler(f ReaderHandler) *GetObjectParams
WithPayloadReaderHandler sets handler of the payload reader.
If provided, payload reader is composed after receiving the header. In this case payload writer set via WithPayloadWriter is ignored.
Handler should not be nil.
func (*GetObjectParams) WithPayloadWriter ¶
func (p *GetObjectParams) WithPayloadWriter(w io.Writer) *GetObjectParams
func (*GetObjectParams) WithRawFlag ¶
func (p *GetObjectParams) WithRawFlag(v bool) *GetObjectParams
type ObjectAddressWriter ¶
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 ¶
func (p *ObjectHeaderParams) Address() *object.Address
func (*ObjectHeaderParams) AllFields ¶
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 ¶
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 ¶
func (p *ObjectHeaderParams) WithRawFlag(v bool) *ObjectHeaderParams
type PutObjectParams ¶
type PutObjectParams struct {
// contains filtered or unexported fields
}
func (*PutObjectParams) Object ¶
func (p *PutObjectParams) Object() *object.Object
func (*PutObjectParams) PayloadReader ¶
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 ¶
func (p *RangeChecksumParams) Address() *object.Address
func (*RangeChecksumParams) RangeList ¶
func (p *RangeChecksumParams) RangeList() []*object.Range
func (*RangeChecksumParams) Salt ¶
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 ¶
func (p *RangeDataParams) Address() *object.Address
func (*RangeDataParams) DataWriter ¶
func (p *RangeDataParams) DataWriter() io.Writer
func (*RangeDataParams) Range ¶
func (p *RangeDataParams) Range() *object.Range
func (*RangeDataParams) Raw ¶
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 ¶
func (p *RangeDataParams) WithRaw(v bool) *RangeDataParams
type SearchObjectParams ¶
type SearchObjectParams struct {
// contains filtered or unexported fields
}
func (*SearchObjectParams) ContainerID ¶
func (p *SearchObjectParams) ContainerID() *cid.ID
func (*SearchObjectParams) SearchFilters ¶
func (p *SearchObjectParams) SearchFilters() object.SearchFilters
func (*SearchObjectParams) WithContainerID ¶
func (p *SearchObjectParams) WithContainerID(v *cid.ID) *SearchObjectParams
func (*SearchObjectParams) WithSearchFilters ¶
func (p *SearchObjectParams) WithSearchFilters(v object.SearchFilters) *SearchObjectParams