Documentation ¶
Overview ¶
Package internal provides functionality for NeoFS Node Object service communication with NeoFS network. The base client for accessing remote nodes via NeoFS API is a NeoFS SDK Go API client. However, although it encapsulates a useful piece of business logic (e.g. the signature mechanism), the Object service does not fully use the client's flexible interface.
In this regard, this package provides functions over base API client necessary for the application. This allows you to concentrate the entire spectrum of the client's use in one place (this will be convenient both when updating the base client and for evaluating the UX of SDK library). So it is expected that all Object service packages will be limited to this package for the development of functionality requiring NeoFS API communication.
Index ¶
- type GetObjectPrm
- type GetObjectRes
- type HeadObjectPrm
- type HeadObjectRes
- type PayloadRangePrm
- type PayloadRangeRes
- type PutObjectPrm
- func (x *PutObjectPrm) SetBearerToken(tok *token.BearerToken)
- func (x *PutObjectPrm) SetClient(cli client.Client)
- func (x *PutObjectPrm) SetContext(ctx context.Context)
- func (x *PutObjectPrm) SetObject(obj *object.Object)
- func (x *PutObjectPrm) SetPrivateKey(key *ecdsa.PrivateKey)
- func (x *PutObjectPrm) SetSessionToken(tok *session.Token)
- func (x *PutObjectPrm) SetXHeaders(xhdrs []*session.XHeader)
- type PutObjectRes
- type SearchObjectsPrm
- type SearchObjectsRes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetObjectPrm ¶
type GetObjectPrm struct {
// contains filtered or unexported fields
}
GetObjectPrm groups parameters of GetObject operation.
func (*GetObjectPrm) SetAddress ¶
func (x *GetObjectPrm) SetAddress(addr *object.Address)
SetAddress sets object address.
Required parameter.
func (*GetObjectPrm) SetNetmapEpoch ¶
func (x *GetObjectPrm) SetNetmapEpoch(epoch uint64)
SetNetmapEpoch sets the epoch number to be used to locate the object.
By default current epoch on the server will be used.
func (*GetObjectPrm) SetRawFlag ¶
func (x *GetObjectPrm) SetRawFlag()
SetRawFlag sets raw flag of the request.
By default request will not be raw.
type GetObjectRes ¶
type GetObjectRes struct {
// contains filtered or unexported fields
}
GetObjectRes groups resulting values of GetObject operation.
func GetObject ¶
func GetObject(prm GetObjectPrm) (res GetObjectRes, err error)
GetObject reads the object by address.
Client, context and key must be set.
Returns any error prevented the operation from completing correctly in error return. Returns:
error of type *object.SplitInfoError if object if raw flag is set and requested object is virtual; object.ErrAlreadyRemoved error if requested object is marked to be removed.
func (GetObjectRes) Object ¶
func (x GetObjectRes) Object() *object.Object
Object returns requested object.
type HeadObjectPrm ¶
type HeadObjectPrm struct {
// contains filtered or unexported fields
}
HeadObjectPrm groups parameters of HeadObject operation.
func (*HeadObjectPrm) SetAddress ¶
func (x *HeadObjectPrm) SetAddress(addr *object.Address)
SetAddress sets object address.
Required parameter.
func (*HeadObjectPrm) SetNetmapEpoch ¶
func (x *HeadObjectPrm) SetNetmapEpoch(epoch uint64)
SetNetmapEpoch sets the epoch number to be used to locate the object.
By default current epoch on the server will be used.
func (*HeadObjectPrm) SetRawFlag ¶
func (x *HeadObjectPrm) SetRawFlag()
SetRawFlag sets raw flag of the request.
By default request will not be raw.
type HeadObjectRes ¶
type HeadObjectRes struct {
// contains filtered or unexported fields
}
GetObjectRes groups resulting values of GetObject operation.
func HeadObject ¶
func HeadObject(prm HeadObjectPrm) (res HeadObjectRes, err error)
HeadObject reads object header by address.
Client, context and key must be set.
Returns any error prevented the operation from completing correctly in error return. Returns:
error of type *object.SplitInfoError if object if raw flag is set and requested object is virtual; object.ErrAlreadyRemoved error if requested object is marked to be removed.
func (HeadObjectRes) Header ¶
func (x HeadObjectRes) Header() *object.Object
Header returns requested object header.
type PayloadRangePrm ¶
type PayloadRangePrm struct {
// contains filtered or unexported fields
}
PayloadRangePrm groups parameters of PayloadRange operation.
func (*PayloadRangePrm) SetAddress ¶
func (x *PayloadRangePrm) SetAddress(addr *object.Address)
SetAddress sets object address.
Required parameter.
func (*PayloadRangePrm) SetNetmapEpoch ¶
func (x *PayloadRangePrm) SetNetmapEpoch(epoch uint64)
SetNetmapEpoch sets the epoch number to be used to locate the object.
By default current epoch on the server will be used.
func (*PayloadRangePrm) SetRange ¶
func (x *PayloadRangePrm) SetRange(rng *object.Range)
SetRange range of the object payload to be read.
Required parameter.
func (*PayloadRangePrm) SetRawFlag ¶
func (x *PayloadRangePrm) SetRawFlag()
SetRawFlag sets raw flag of the request.
By default request will not be raw.
type PayloadRangeRes ¶
type PayloadRangeRes struct {
// contains filtered or unexported fields
}
PayloadRangeRes groups resulting values of GetObject operation.
func PayloadRange ¶
func PayloadRange(prm PayloadRangePrm) (res PayloadRangeRes, err error)
PayloadRange reads object payload range by address.
Client, context and key must be set.
Returns any error prevented the operation from completing correctly in error return. Returns:
error of type *object.SplitInfoError if object if raw flag is set and requested object is virtual; object.ErrAlreadyRemoved error if requested object is marked to be removed.
func (PayloadRangeRes) PayloadRange ¶
func (x PayloadRangeRes) PayloadRange() []byte
PayloadRange returns data of the requested payload range.
type PutObjectPrm ¶
type PutObjectPrm struct {
// contains filtered or unexported fields
}
PutObjectPrm groups parameters of PutObject operation.
func (*PutObjectPrm) SetBearerToken ¶
func (x *PutObjectPrm) SetBearerToken(tok *token.BearerToken)
SetBearerToken sets bearer token to be attached to the request.
By default token is not attached to the request.
func (*PutObjectPrm) SetClient ¶
SetClient sets base client for NeoFS API communication.
Required parameter.
func (*PutObjectPrm) SetContext ¶
SetContext sets context.Context for network communication.
Required parameter.
func (*PutObjectPrm) SetObject ¶
func (x *PutObjectPrm) SetObject(obj *object.Object)
SetObject sets object to be stored.
Required parameter.
func (*PutObjectPrm) SetPrivateKey ¶
func (x *PutObjectPrm) SetPrivateKey(key *ecdsa.PrivateKey)
SetPrivateKey sets private key to sign the request(s).
Required parameter.
func (*PutObjectPrm) SetSessionToken ¶
SetSessionToken sets token of the session within which request should be sent.
By default the request will be sent outside the session.
func (*PutObjectPrm) SetXHeaders ¶
SetXHeaders sets request X-Headers.
By default X-Headers will not be attached to the request.
type PutObjectRes ¶
type PutObjectRes struct {
// contains filtered or unexported fields
}
PutObjectRes groups resulting values of PutObject operation.
func PutObject ¶
func PutObject(prm PutObjectPrm) (res PutObjectRes, err error)
PutObject saves the object in local storage of the remote node.
Client, context and key must be set.
Returns any error prevented the operation from completing correctly in error return.
func (PutObjectRes) ID ¶
func (x PutObjectRes) ID() *object.ID
ID returns identifier of the stored object.
type SearchObjectsPrm ¶
type SearchObjectsPrm struct {
// contains filtered or unexported fields
}
SearchObjectsPrm groups parameters of SearchObjects operation.
func (*SearchObjectsPrm) SetContainerID ¶
func (x *SearchObjectsPrm) SetContainerID(id *cid.ID)
SetContainerID sets identifier of the container to search the objects.
Required parameter.
func (*SearchObjectsPrm) SetFilters ¶
func (x *SearchObjectsPrm) SetFilters(fs object.SearchFilters)
SetFilters sets search filters.
func (*SearchObjectsPrm) SetNetmapEpoch ¶
func (x *SearchObjectsPrm) SetNetmapEpoch(epoch uint64)
SetNetmapEpoch sets the epoch number to be used to locate the object.
By default current epoch on the server will be used.
type SearchObjectsRes ¶
type SearchObjectsRes struct {
// contains filtered or unexported fields
}
SearchObjectsRes groups resulting values of SearchObjects operation.
func SearchObjects ¶
func SearchObjects(prm SearchObjectsPrm) (res SearchObjectsRes, err error)
SearchObjects selects objects from container which match the filters.
Returns any error prevented the operation from completing correctly in error return.
func (SearchObjectsRes) IDList ¶
func (x SearchObjectsRes) IDList() []*object.ID
IDList returns identifiers of the matched objects.