Documentation
¶
Index ¶
- Constants
- Variables
- func FormEncryptionInfo(headers map[string]string) encryption.ObjectEncryption
- func GetBoxData(ctx context.Context) (*accessbox.Box, error)
- func IsAuthenticatedRequest(ctx context.Context) bool
- func IsSystemHeader(key string) bool
- func MimeByFilePath(path string) string
- func TimeNow(ctx context.Context) time.Time
- type BucketACL
- type Cache
- func (c *Cache) CleanListCacheEntriesContainingObject(objectName string, cnrID cid.ID)
- func (c *Cache) DeleteBucket(name string)
- func (c *Cache) DeleteCORS(bktInfo *data.BucketInfo)
- func (c *Cache) DeleteObject(addr oid.Address)
- func (c *Cache) DeleteObjectName(cnrID cid.ID, bktName, objName string)
- func (c *Cache) DeleteTagging(key string)
- func (c *Cache) GetBucket(name string) *data.BucketInfo
- func (c *Cache) GetBucketACL(id cid.ID) *eacl.Table
- func (c *Cache) GetCORS(owner user.ID, bkt *data.BucketInfo) *data.CORSConfiguration
- func (c *Cache) GetLastObject(owner user.ID, bktName, objName string) *data.ExtendedObjectInfo
- func (c *Cache) GetList(owner user.ID, key cache.ObjectsListKey) []*data.NodeVersion
- func (c *Cache) GetLockInfo(owner user.ID, key string) *data.LockInfo
- func (c *Cache) GetNotificationConfiguration(owner user.ID, bktInfo *data.BucketInfo) *data.NotificationConfiguration
- func (c *Cache) GetObject(owner user.ID, addr oid.Address) *data.ExtendedObjectInfo
- func (c *Cache) GetSettings(bktInfo *data.BucketInfo) *data.BucketSettings
- func (c *Cache) GetTagging(owner user.ID, key string) map[string]string
- func (c *Cache) PutBucket(bktInfo *data.BucketInfo)
- func (c *Cache) PutBucketACL(id cid.ID, acl *eacl.Table)
- func (c *Cache) PutCORS(owner user.ID, bkt *data.BucketInfo, cors *data.CORSConfiguration)
- func (c *Cache) PutList(owner user.ID, key cache.ObjectsListKey, list []*data.NodeVersion)
- func (c *Cache) PutLockInfo(owner user.ID, key string, lockInfo *data.LockInfo)
- func (c *Cache) PutNotificationConfiguration(owner user.ID, bktInfo *data.BucketInfo, ...)
- func (c *Cache) PutObject(owner user.ID, extObjInfo *data.ExtendedObjectInfo)
- func (c *Cache) PutObjectWithName(owner user.ID, extObjInfo *data.ExtendedObjectInfo)
- func (c *Cache) PutSettings(bktInfo *data.BucketInfo, settings *data.BucketSettings)
- func (c *Cache) PutTagging(owner user.ID, key string, tags map[string]string)
- type CachesConfig
- type Client
- type CompleteMultipartParams
- type CompletedPart
- type Config
- type CopyObjectParams
- type CreateBucketParams
- type CreateMultipartParams
- type DeleteBucketParams
- type DeleteObjectParams
- type EncryptedPart
- type EventListener
- type GetObject
- type GetObjectParams
- type GetObjectTaggingParams
- type GetObjectWithPayloadReaderParams
- type HeadObjectParams
- type ListMultipartUploadsInfo
- type ListMultipartUploadsParams
- type ListObjectVersionsInfo
- type ListObjectVersionsParams
- type ListObjectsInfo
- type ListObjectsInfoV1
- type ListObjectsInfoV2
- type ListObjectsParamsCommon
- type ListObjectsParamsV1
- type ListObjectsParamsV2
- type ListPartsInfo
- type ListPartsParams
- type MsgHandler
- type MsgHandlerFunc
- type Multipart
- type MultipartHashes
- type NeoFS
- type ObjectPart
- type ObjectVersion
- type ObjectWithPayloadReader
- type Part
- type PlacementPolicy
- type PrmAuth
- type PrmContainerCreate
- type PrmObjectCreate
- type PrmObjectDelete
- type PrmObjectRead
- type PrmObjectSearch
- type PutBucketACLParams
- type PutBucketNotificationConfigurationParams
- type PutCORSParams
- type PutLockInfoParams
- type PutObjectParams
- type PutObjectTaggingParams
- type PutSettingsParams
- type RangeParams
- type Resolver
- type ShortInfoParams
- type TestNeoFS
- func (t *TestNeoFS) AddObject(key string, obj *object.Object)
- func (t *TestNeoFS) AllObjects(cnrID cid.ID) []oid.ID
- func (t *TestNeoFS) Container(_ context.Context, id cid.ID) (*container.Container, error)
- func (t *TestNeoFS) ContainerEACL(_ context.Context, cnrID cid.ID) (*eacl.Table, error)
- func (t *TestNeoFS) ContainerID(name string) (cid.ID, error)
- func (t *TestNeoFS) CreateContainer(_ context.Context, prm PrmContainerCreate) (cid.ID, error)
- func (t *TestNeoFS) CreateContainerAndSetEACL(ctx context.Context, prm PrmContainerCreate, table eacl.Table, ...) (cid.ID, error)
- func (t *TestNeoFS) CreateObject(_ context.Context, prm PrmObjectCreate) (oid.ID, error)
- func (t *TestNeoFS) CurrentEpoch() uint64
- func (t *TestNeoFS) DeleteContainer(_ context.Context, cnrID cid.ID, _ *session.Container) error
- func (t *TestNeoFS) DeleteObject(ctx context.Context, prm PrmObjectDelete) error
- func (t *TestNeoFS) FinalizeObjectWithPayloadChecksums(_ context.Context, header object.Object, metaChecksum hash.Hash, ...) (*object.Object, error)
- func (t *TestNeoFS) GetObject(ctx context.Context, prm GetObject) (*ObjectPart, error)
- func (t *TestNeoFS) IsHomomorphicHashingEnabled() bool
- func (t *TestNeoFS) MaxObjectSize() int64
- func (t *TestNeoFS) Objects() []*object.Object
- func (t *TestNeoFS) ReadObject(ctx context.Context, prm PrmObjectRead) (*ObjectPart, error)
- func (t *TestNeoFS) SearchObjects(_ context.Context, prm PrmObjectSearch) ([]oid.ID, error)
- func (t *TestNeoFS) SearchObjectsV2(_ context.Context, cid cid.ID, filters object.SearchFilters, ...) ([]client.SearchResultItem, error)
- func (t *TestNeoFS) SearchObjectsV2WithCursor(_ context.Context, cid cid.ID, filters object.SearchFilters, ...) ([]client.SearchResultItem, string, error)
- func (t *TestNeoFS) SetContainerEACL(_ context.Context, table eacl.Table, _ *session.Container) error
- func (t *TestNeoFS) TimeToEpoch(_ context.Context, now, futureTime time.Time) (uint64, uint64, error)
- func (t *TestNeoFS) UserContainers(_ context.Context, _ user.ID) ([]cid.ID, error)
- type UploadCopyParams
- type UploadData
- type UploadInfo
- type UploadInfoParams
- type UploadPartParams
- type VersionedObject
Constants ¶
const ( AESEncryptionAlgorithm = "AES256" AESKeySize = 32 AttributeNeofsCopiesNumber = "neofs-copies-number" // such format to match X-Amz-Meta-Neofs-Copies-Number header PlacementPolicyV1 = 1 )
const ( MaxSizeUploadsList = 1000 MaxSizePartsList = 1000 UploadMinPartNumber = 1 UploadMaxPartNumber = 10000 )
const (
AttributeLockEnabled = "LockEnabled"
)
Variables ¶
var ( // ErrNodeNotFound is returned in case of not found error. ErrNodeNotFound = errors.New("not found") // ErrNodeAccessDenied is returned in case of access denied error. ErrNodeAccessDenied = errors.New("access denied") // ErrPartListIsEmpty is returned if no parts available for the upload. ErrPartListIsEmpty = errors.New("part list is empty") )
var ErrAccessDenied = errors.New("access denied")
ErrAccessDenied is returned from NeoFS in case of access violation.
var ErrDecodeUserID = errors.New("decode user.ID failed")
ErrDecodeUserID is returned if user.ID decode failed.
var ErrMetaEmptyParameterValue = errors.New("meta empty parameter value")
ErrMetaEmptyParameterValue describes situation when meta parameter was passed but with empty value.
var ErrTooManyObjectForDeletion = errors.New("to many objects for deletion")
ErrTooManyObjectForDeletion is returned if user is trying to delete to many objects per request.
Functions ¶
func FormEncryptionInfo ¶ added in v0.24.0
func FormEncryptionInfo(headers map[string]string) encryption.ObjectEncryption
func GetBoxData ¶ added in v0.17.0
GetBoxData extracts accessbox.Box from context.
func IsAuthenticatedRequest ¶ added in v0.19.0
IsAuthenticatedRequest checks if access box exists in the current request.
func IsSystemHeader ¶ added in v0.19.0
func MimeByFilePath ¶ added in v0.24.0
MimeByFilePath detect mime type by file path extension.
Types ¶
type BucketACL ¶ added in v0.17.0
type BucketACL struct {
Info *data.BucketInfo
EACL *eacl.Table
}
BucketACL extends BucketInfo by eacl.Table.
type Cache ¶ added in v0.25.0
type Cache struct {
// contains filtered or unexported fields
}
func NewCache ¶ added in v0.25.0
func NewCache(cfg *CachesConfig) *Cache
func (*Cache) CleanListCacheEntriesContainingObject ¶ added in v0.25.0
func (*Cache) DeleteBucket ¶ added in v0.25.0
func (*Cache) DeleteCORS ¶ added in v0.25.0
func (c *Cache) DeleteCORS(bktInfo *data.BucketInfo)
func (*Cache) DeleteObject ¶ added in v0.25.0
func (*Cache) DeleteObjectName ¶ added in v0.25.0
func (*Cache) DeleteTagging ¶ added in v0.25.0
func (*Cache) GetCORS ¶ added in v0.25.0
func (c *Cache) GetCORS(owner user.ID, bkt *data.BucketInfo) *data.CORSConfiguration
func (*Cache) GetLastObject ¶ added in v0.25.0
func (*Cache) GetList ¶ added in v0.25.0
func (c *Cache) GetList(owner user.ID, key cache.ObjectsListKey) []*data.NodeVersion
func (*Cache) GetLockInfo ¶ added in v0.25.0
func (*Cache) GetNotificationConfiguration ¶ added in v0.25.0
func (c *Cache) GetNotificationConfiguration(owner user.ID, bktInfo *data.BucketInfo) *data.NotificationConfiguration
func (*Cache) GetSettings ¶ added in v0.25.0
func (c *Cache) GetSettings(bktInfo *data.BucketInfo) *data.BucketSettings
func (*Cache) GetTagging ¶ added in v0.25.0
func (*Cache) PutBucket ¶ added in v0.25.0
func (c *Cache) PutBucket(bktInfo *data.BucketInfo)
func (*Cache) PutBucketACL ¶ added in v0.33.0
func (*Cache) PutCORS ¶ added in v0.25.0
func (c *Cache) PutCORS(owner user.ID, bkt *data.BucketInfo, cors *data.CORSConfiguration)
func (*Cache) PutList ¶ added in v0.25.0
func (c *Cache) PutList(owner user.ID, key cache.ObjectsListKey, list []*data.NodeVersion)
func (*Cache) PutLockInfo ¶ added in v0.25.0
func (*Cache) PutNotificationConfiguration ¶ added in v0.25.0
func (c *Cache) PutNotificationConfiguration(owner user.ID, bktInfo *data.BucketInfo, configuration *data.NotificationConfiguration)
func (*Cache) PutObject ¶ added in v0.25.0
func (c *Cache) PutObject(owner user.ID, extObjInfo *data.ExtendedObjectInfo)
func (*Cache) PutObjectWithName ¶ added in v0.25.0
func (c *Cache) PutObjectWithName(owner user.ID, extObjInfo *data.ExtendedObjectInfo)
func (*Cache) PutSettings ¶ added in v0.25.0
func (c *Cache) PutSettings(bktInfo *data.BucketInfo, settings *data.BucketSettings)
type CachesConfig ¶ added in v0.17.0
type CachesConfig struct {
Logger *zap.Logger
Objects *cache.Config
ObjectsList *cache.Config
Names *cache.Config
Buckets *cache.Config
BucketACLs *cache.Config
System *cache.Config
AccessControl *cache.Config
}
CachesConfig contains params for caches.
func DefaultCachesConfigs ¶ added in v0.17.0
func DefaultCachesConfigs(logger *zap.Logger) *CachesConfig
DefaultCachesConfigs returns filled configs.
type Client ¶
type Client interface {
Initialize(ctx context.Context, c EventListener) error
GetBucketSettings(ctx context.Context, bktInfo *data.BucketInfo) (*data.BucketSettings, error)
PutBucketSettings(ctx context.Context, p *PutSettingsParams) error
PutBucketCORS(ctx context.Context, p *PutCORSParams) error
GetBucketCORS(ctx context.Context, bktInfo *data.BucketInfo) (*data.CORSConfiguration, error)
DeleteBucketCORS(ctx context.Context, bktInfo *data.BucketInfo) error
ListBuckets(ctx context.Context) ([]*data.BucketInfo, error)
GetBucketInfo(ctx context.Context, name string) (*data.BucketInfo, error)
GetBucketACL(ctx context.Context, bktInfo *data.BucketInfo) (*BucketACL, error)
PutBucketACL(ctx context.Context, p *PutBucketACLParams) error
CreateBucket(ctx context.Context, p *CreateBucketParams) (*data.BucketInfo, error)
DeleteBucket(ctx context.Context, p *DeleteBucketParams) error
GetObject(ctx context.Context, p *GetObjectParams) error
GetObjectWithPayloadReader(ctx context.Context, p *GetObjectWithPayloadReaderParams) (*ObjectWithPayloadReader, error)
GetObjectInfo(ctx context.Context, p *HeadObjectParams) (*data.ObjectInfo, error)
GetExtendedObjectInfo(ctx context.Context, p *HeadObjectParams) (*data.ExtendedObjectInfo, error)
ComprehensiveObjectInfo(ctx context.Context, p *HeadObjectParams) (*data.ComprehensiveObjectInfo, error)
GetIDForVersioningContainer(ctx context.Context, p *ShortInfoParams) (oid.ID, error)
GetLockInfo(ctx context.Context, obj *ObjectVersion) (*data.LockInfo, error)
PutLockInfo(ctx context.Context, p *PutLockInfoParams) error
GetBucketTagging(ctx context.Context, bktInfo *data.BucketInfo) (map[string]string, error)
PutBucketTagging(ctx context.Context, bktInfo *data.BucketInfo, tagSet map[string]string, copiesNumber uint32) error
DeleteBucketTagging(ctx context.Context, bktInfo *data.BucketInfo) error
GetObjectTagging(ctx context.Context, p *GetObjectTaggingParams) (string, map[string]string, error)
PutObjectTagging(ctx context.Context, p *PutObjectTaggingParams) error
DeleteObjectTagging(ctx context.Context, p *ObjectVersion, copiesNumber uint32) error
PutObject(ctx context.Context, p *PutObjectParams) (*data.ExtendedObjectInfo, error)
CopyObject(ctx context.Context, p *CopyObjectParams) (*data.ExtendedObjectInfo, error)
ListObjectsV1(ctx context.Context, p *ListObjectsParamsV1) (*ListObjectsInfoV1, error)
ListObjectsV2(ctx context.Context, p *ListObjectsParamsV2) (*ListObjectsInfoV2, error)
ListObjectVersions(ctx context.Context, p *ListObjectVersionsParams) (*ListObjectVersionsInfo, error)
DeleteObjects(ctx context.Context, p *DeleteObjectParams) []*VersionedObject
CreateMultipartUpload(ctx context.Context, p *CreateMultipartParams) (string, error)
CompleteMultipartUpload(ctx context.Context, p *CompleteMultipartParams) (*UploadData, *data.ExtendedObjectInfo, error)
UploadPart(ctx context.Context, p *UploadPartParams) (string, error)
UploadPartCopy(ctx context.Context, p *UploadCopyParams) (*data.ObjectInfo, error)
ListMultipartUploads(ctx context.Context, p *ListMultipartUploadsParams) (*ListMultipartUploadsInfo, error)
AbortMultipartUpload(ctx context.Context, p *UploadInfoParams) error
ListParts(ctx context.Context, p *ListPartsParams) (*ListPartsInfo, error)
PutBucketNotificationConfiguration(ctx context.Context, p *PutBucketNotificationConfigurationParams) error
GetBucketNotificationConfiguration(ctx context.Context, bktInfo *data.BucketInfo) (*data.NotificationConfiguration, error)
// GetObjectTaggingAndLock unifies GetObjectTagging and GetLock methods in a single search invocation.
GetObjectTaggingAndLock(ctx context.Context, p *ObjectVersion) (map[string]string, *data.LockInfo, error)
}
Client provides S3 API client interface.
type CompleteMultipartParams ¶ added in v0.18.0
type CompleteMultipartParams struct {
Info *UploadInfoParams
Parts []*CompletedPart
}
type CompletedPart ¶ added in v0.18.0
type Config ¶ added in v0.18.0
type Config struct {
ChainAddress string
Caches *CachesConfig
GateKey *keys.PrivateKey
Anonymous user.ID
Resolver Resolver
}
type CopyObjectParams ¶
type CopyObjectParams struct {
SrcObject *data.ObjectInfo
ScrBktInfo *data.BucketInfo
DstBktInfo *data.BucketInfo
DstObject string
SrcSize int64
Header map[string]string
Range *RangeParams
Lock *data.ObjectLock
Encryption encryption.Params
CopiesNuber uint32
}
CopyObjectParams stores object copy request parameters.
type CreateBucketParams ¶ added in v0.16.0
type CreateBucketParams struct {
Name string
Policy PlacementPolicy
EACL *eacl.Table
SessionContainerCreation *session.Container
SessionEACL *session.Container
LocationConstraint string
ObjectLockEnabled bool
}
CreateBucketParams stores bucket create request parameters.
type CreateMultipartParams ¶ added in v0.22.0
type CreateMultipartParams struct {
Info *UploadInfoParams
Header map[string]string
Data *UploadData
CopiesNumber uint32
}
type DeleteBucketParams ¶ added in v0.16.0
type DeleteBucketParams struct {
BktInfo *data.BucketInfo
SessionToken *session.Container
}
DeleteBucketParams stores delete bucket request parameters.
type DeleteObjectParams ¶ added in v0.20.0
type DeleteObjectParams struct {
BktInfo *data.BucketInfo
Objects []*VersionedObject
Settings *data.BucketSettings
}
type EncryptedPart ¶ added in v0.24.0
type EventListener ¶ added in v0.21.0
type GetObject ¶ added in v0.35.0
type GetObject struct {
// Authentication parameters.
PrmAuth
// Container to read the object header from.
Container cid.ID
// ID of the object for which to read the header.
Object oid.ID
}
GetObject groups parameters of NeoFS.ReadObject operation.
type GetObjectParams ¶
type GetObjectParams struct {
Range *RangeParams
ObjectInfo *data.ObjectInfo
BucketInfo *data.BucketInfo
Writer io.Writer
Encryption encryption.Params
}
GetObjectParams stores object get request parameters.
type GetObjectTaggingParams ¶ added in v0.25.0
type GetObjectTaggingParams struct {
ObjectVersion *ObjectVersion
}
type GetObjectWithPayloadReaderParams ¶ added in v0.35.0
type GetObjectWithPayloadReaderParams struct {
Owner user.ID
BktInfo *data.BucketInfo
Object oid.ID
}
GetObjectWithPayloadReaderParams describes params for Client.GetObjectWithPayloadReader.
type HeadObjectParams ¶ added in v0.17.0
type HeadObjectParams struct {
BktInfo *data.BucketInfo
Object string
VersionID string
IsBucketVersioningEnabled bool
}
HeadObjectParams stores object head request parameters.
type ListMultipartUploadsInfo ¶ added in v0.18.0
type ListMultipartUploadsInfo struct {
Prefixes []string
Uploads []*UploadInfo
IsTruncated bool
NextKeyMarker string
NextUploadIDMarker string
}
type ListMultipartUploadsParams ¶ added in v0.18.0
type ListObjectVersionsInfo ¶ added in v0.16.0
type ListObjectVersionsInfo struct {
CommonPrefixes []string
IsTruncated bool
KeyMarker string
NextKeyMarker string
NextVersionIDMarker string
Version []*data.ExtendedObjectInfo
DeleteMarker []*data.ExtendedObjectInfo
VersionIDMarker string
}
ListObjectVersionsInfo stores info and list of objects versions.
type ListObjectVersionsParams ¶ added in v0.16.0
type ListObjectVersionsParams struct {
BktInfo *data.BucketInfo
Delimiter string
KeyMarker string
MaxKeys int
Prefix string
VersionIDMarker string
Encode string
}
ListObjectVersionsParams stores list objects versions parameters.
type ListObjectsInfo ¶
type ListObjectsInfo struct {
Prefixes []string
Objects []data.ObjectListResponseContent
IsTruncated bool
}
ListObjectsInfo contains common fields of data for ListObjectsV1 and ListObjectsV2.
type ListObjectsInfoV1 ¶ added in v0.17.0
type ListObjectsInfoV1 struct {
ListObjectsInfo
NextMarker string
}
ListObjectsInfoV1 holds data which ListObjectsV1 returns.
type ListObjectsInfoV2 ¶ added in v0.17.0
type ListObjectsInfoV2 struct {
ListObjectsInfo
NextContinuationToken string
}
ListObjectsInfoV2 holds data which ListObjectsV2 returns.
type ListObjectsParamsCommon ¶ added in v0.17.0
type ListObjectsParamsCommon struct {
BktInfo *data.BucketInfo
Delimiter string
Encode string
MaxKeys int
Prefix string
}
ListObjectsParamsCommon contains common parameters for ListObjectsV1 and ListObjectsV2.
type ListObjectsParamsV1 ¶ added in v0.17.0
type ListObjectsParamsV1 struct {
ListObjectsParamsCommon
Marker string
}
ListObjectsParamsV1 contains params for ListObjectsV1.
type ListObjectsParamsV2 ¶ added in v0.17.0
type ListObjectsParamsV2 struct {
ListObjectsParamsCommon
ContinuationToken string
StartAfter string
FetchOwner bool
}
ListObjectsParamsV2 contains params for ListObjectsV2.
type ListPartsInfo ¶ added in v0.18.0
type ListPartsParams ¶ added in v0.18.0
type ListPartsParams struct {
Info *UploadInfoParams
MaxParts int
PartNumberMarker int
}
type MsgHandler ¶ added in v0.20.0
type MsgHandlerFunc ¶ added in v0.20.0
func (MsgHandlerFunc) HandleMessage ¶ added in v0.20.0
func (f MsgHandlerFunc) HandleMessage(ctx context.Context, msg *nats.Msg) error
type Multipart ¶ added in v0.30.0
type Multipart struct {
// MultipartHashes contains hashes for the multipart object payload calculation (optional).
MultipartHashes *MultipartHashes
// SplitPreviousID contains [oid.ID] of previous object in chain (optional).
SplitPreviousID *oid.ID
// SplitFirstID contains [oid.ID] of the first object in chain (The first object has nil here).
SplitFirstID *oid.ID
// HeaderObject is a virtual representation of complete multipart object (optional). It is used to set Parent in
// linking object.
HeaderObject *object.Object
// Link contains info for linking object.
Link *object.Link
// PayloadHash contains precalculated hash for object.
PayloadHash hash.Hash
// HomoHash contains precalculated homomorphic hash for object if enabled.
HomoHash hash.Hash
}
Multipart contains info for local object slicing inside s3-gate during multipart upload operation.
type MultipartHashes ¶ added in v0.36.0
type MultipartHashes struct {
// Hash contains hash for the payload of the whole "big" multipart uploaded object.
Hash hash.Hash
// HomoHash contains homo hash (if enabled) for the payload of the whole "big" multipart uploaded object.
HomoHash hash.Hash
// PartHash contains hash for separate part in multipart upload.
PartHash hash.Hash
}
MultipartHashes describe hash collection for multipart uploads.
func (*MultipartHashes) WritePayload ¶ added in v0.36.0
func (h *MultipartHashes) WritePayload(bts []byte) error
WritePayload writes bts to each available hash.
type NeoFS ¶
type NeoFS interface {
// CreateContainer creates and saves parameterized container in NeoFS.
// It sets 'Timestamp' attribute to the current time.
// It returns the ID of the saved container.
//
// Created container is public with enabled ACL extension.
//
// It returns exactly one non-zero value. It returns any error encountered which
// prevented the container from being created.
CreateContainer(context.Context, PrmContainerCreate) (cid.ID, error)
// Container reads a container from NeoFS by ID.
//
// It returns exactly one non-nil value. It returns any error encountered which
// prevented the container from being read.
Container(context.Context, cid.ID) (*container.Container, error)
// UserContainers reads a list of the containers owned by the specified user.
//
// It returns exactly one non-nil value. It returns any error encountered which
// prevented the containers from being listed.
UserContainers(context.Context, user.ID) ([]cid.ID, error)
// SetContainerEACL saves the eACL table of the container in NeoFS. The
// extended ACL is modified within session if session token is not nil.
//
// It returns any error encountered which prevented the eACL from being saved.
SetContainerEACL(context.Context, eacl.Table, *session.Container) error
// CreateContainerAndSetEACL creates container and sets EACL using the same rawClient.
CreateContainerAndSetEACL(ctx context.Context, prm PrmContainerCreate, table eacl.Table, sessionToken *session.Container) (cid.ID, error)
// ContainerEACL reads the container eACL from NeoFS by the container ID.
//
// It returns exactly one non-nil value. It returns any error encountered which
// prevented the eACL from being read.
ContainerEACL(context.Context, cid.ID) (*eacl.Table, error)
// DeleteContainer marks the container to be removed from NeoFS by ID.
// Request is sent within session if the session token is specified.
// Successful return does not guarantee actual removal.
//
// It returns any error encountered which prevented the removal request from being sent.
DeleteContainer(context.Context, cid.ID, *session.Container) error
// ReadObject reads a part of the object from the NeoFS container by identifier.
// Exact part is returned according to the parameters:
// * with header only: empty payload (both in-mem and reader parts are nil);
// * with payload only: header is nil (zero range means full payload);
// * with header and payload: full in-mem object, payload reader is nil.
//
// WithHeader or WithPayload is true. Range length is positive if offset is positive.
//
// Payload reader should be closed if it is no longer needed.
//
// It returns ErrAccessDenied on read access violation.
//
// It returns exactly one non-nil value. It returns any error encountered which
// prevented the object header from being read.
ReadObject(context.Context, PrmObjectRead) (*ObjectPart, error)
// GetObject returns object head and payload Reader.
GetObject(ctx context.Context, prm GetObject) (*ObjectPart, error)
// CreateObject creates and saves a parameterized object in the NeoFS container.
// It sets 'Timestamp' attribute to the current time.
// It returns the ID of the saved object.
//
// Creation time should be written into the object (UTC).
//
// It returns ErrAccessDenied on write access violation.
//
// It returns exactly one non-zero value. It returns any error encountered which
// prevented the container from being created.
CreateObject(context.Context, PrmObjectCreate) (oid.ID, error)
// FinalizeObjectWithPayloadChecksums fills and signs header object for complete multipart object.
FinalizeObjectWithPayloadChecksums(context.Context, object.Object, hash.Hash, hash.Hash, uint64) (*object.Object, error)
// DeleteObject marks the object to be removed from the NeoFS container by identifier.
// Successful return does not guarantee actual removal.
//
// It returns ErrAccessDenied on remove access violation.
//
// It returns any error encountered which prevented the removal request from being sent.
DeleteObject(context.Context, PrmObjectDelete) error
// TimeToEpoch computes current epoch and the epoch that corresponds to the provided now and future time.
// Note:
// * future time must be after the now
// * future time will be ceil rounded to match epoch
//
// It returns any error encountered which prevented computing epochs.
TimeToEpoch(ctx context.Context, now time.Time, future time.Time) (uint64, uint64, error)
// MaxObjectSize returns configured payload size limit for object slicing when enabled.
MaxObjectSize() int64
// IsHomomorphicHashingEnabled shows if homomorphic hashing is enabled in config.
IsHomomorphicHashingEnabled() bool
// CurrentEpoch returns current epoch.
CurrentEpoch() uint64
// SearchObjects searches objects with corresponding filters.
SearchObjects(ctx context.Context, prm PrmObjectSearch) ([]oid.ID, error)
// SearchObjectsV2 searches objects with corresponding filters and return objectID with requested attributes.
SearchObjectsV2(context.Context, cid.ID, object.SearchFilters, []string, client.SearchObjectsOptions) ([]client.SearchResultItem, error)
// SearchObjectsV2WithCursor searches objects with corresponding filters and return objectID with requested attributes. It uses cursor to start from required point.
SearchObjectsV2WithCursor(ctx context.Context, cid cid.ID, filters object.SearchFilters, attributes []string, cursor string, opts client.SearchObjectsOptions) ([]client.SearchResultItem, string, error)
}
NeoFS represents virtual connection to NeoFS network.
type ObjectPart ¶ added in v0.19.0
type ObjectPart struct {
// Object header with optional in-memory payload part.
Head *object.Object
// Object payload part encapsulated in io.Reader primitive.
// Returns ErrAccessDenied on read access violation.
Payload io.ReadCloser
}
ObjectPart represents partially read NeoFS object.
type ObjectVersion ¶ added in v0.22.0
type ObjectVersion struct {
BktInfo *data.BucketInfo
ObjectName string
VersionID string
}
ObjectVersion stores object version info.
type ObjectWithPayloadReader ¶ added in v0.35.0
type ObjectWithPayloadReader struct {
Head *object.Object
Payload io.ReadCloser
ObjectInfo *data.ObjectInfo
}
ObjectWithPayloadReader is a response for Client.GetObjectWithPayloadReader.
type Part ¶ added in v0.18.0
func ParseCompletedPartHeader ¶ added in v0.24.0
type PlacementPolicy ¶ added in v0.37.0
type PlacementPolicy struct {
Version int `json:"version"`
Placement netmap.PlacementPolicy `json:"placement"`
Consistency string `json:"consistency"`
}
type PrmAuth ¶ added in v0.19.0
type PrmAuth struct {
// Bearer token to be used for the operation. Overlaps PrivateKey. Optional.
BearerToken *bearer.Token
}
PrmAuth groups authentication parameters for the NeoFS operation.
type PrmContainerCreate ¶ added in v0.19.0
type PrmContainerCreate struct {
// NeoFS identifier of the container creator.
Creator user.ID
// Container placement policy.
Policy PlacementPolicy
// Name for the container.
Name string
// CreationTime value for Timestamp attribute
CreationTime time.Time
// Token of the container's creation session. Nil means session absence.
SessionToken *session.Container
// Basic ACL of the container.
BasicACL acl.Basic
// Attributes for optional parameters.
AdditionalAttributes [][2]string
// Executor allows to set-up custom executor to the operation.
Executor waiter.ContainerPutExecutor
}
PrmContainerCreate groups parameters of NeoFS.CreateContainer operation.
type PrmObjectCreate ¶ added in v0.19.0
type PrmObjectCreate struct {
// Authentication parameters.
PrmAuth
// Container to store the object.
Container cid.ID
// NeoFS identifier of the object creator.
Creator user.ID
// Key-value object attributes.
Attributes map[string]string
// Value for Timestamp attribute (optional).
CreationTime time.Time
// ID to lock (optional).
Locked oid.ID
// Full payload size (optional).
PayloadSize uint64
// Associated filepath (optional).
Filepath string
// Object payload encapsulated in io.Reader primitive.
Payload io.Reader
// Number of object copies that is enough to consider put successful.
CopiesNumber uint32
Multipart *Multipart
}
PrmObjectCreate groups parameters of NeoFS.CreateObject operation.
type PrmObjectDelete ¶ added in v0.19.0
type PrmObjectDelete struct {
// Authentication parameters.
PrmAuth
// Container to delete the object from.
Container cid.ID
// Identifier of the removed object.
Object oid.ID
}
PrmObjectDelete groups parameters of NeoFS.DeleteObject operation.
type PrmObjectRead ¶ added in v0.19.0
type PrmObjectRead struct {
// Authentication parameters.
PrmAuth
// Container to read the object header from.
Container cid.ID
// ID of the object for which to read the header.
Object oid.ID
// Flag to read object header.
WithHeader bool
// Flag to read object payload. False overlaps payload range.
WithPayload bool
// Offset-length range of the object payload to be read.
PayloadRange [2]uint64
}
PrmObjectRead groups parameters of NeoFS.ReadObject operation.
type PrmObjectSearch ¶ added in v0.33.0
type PrmObjectSearch struct {
// Authentication parameters.
PrmAuth
// Container to read the object header from.
Container cid.ID
// Filters for object filtering.
Filters object.SearchFilters
// XHeaders for object filtering.
XHeaders []string
}
PrmObjectSearch groups parameters of NeoFS.SearchObjects operation.
type PutBucketACLParams ¶ added in v0.17.0
type PutBucketACLParams struct {
BktInfo *data.BucketInfo
EACL *eacl.Table
SessionToken *session.Container
}
PutBucketACLParams stores put bucket acl request parameters.
type PutBucketNotificationConfigurationParams ¶ added in v0.19.0
type PutBucketNotificationConfigurationParams struct {
RequestInfo *api.ReqInfo
BktInfo *data.BucketInfo
Configuration *data.NotificationConfiguration
CopiesNumber uint32
}
type PutCORSParams ¶ added in v0.18.0
type PutCORSParams struct {
BktInfo *data.BucketInfo
Reader io.Reader
CopiesNumber uint32
}
PutCORSParams stores PutCORS request parameters.
type PutLockInfoParams ¶ added in v0.24.0
type PutLockInfoParams struct {
ObjVersion *ObjectVersion
NewLock *data.ObjectLock
CopiesNumber uint32
}
type PutObjectParams ¶
type PutObjectParams struct {
BktInfo *data.BucketInfo
Object string
Size int64
Reader io.Reader
Header map[string]string
Lock *data.ObjectLock
Encryption encryption.Params
CopiesNumber uint32
Tags map[string]string
}
PutObjectParams stores object put request parameters.
type PutObjectTaggingParams ¶ added in v0.25.0
type PutObjectTaggingParams struct {
ObjectVersion *ObjectVersion
TagSet map[string]string
CopiesNumber uint32
}
type PutSettingsParams ¶ added in v0.20.0
type PutSettingsParams struct {
BktInfo *data.BucketInfo
Settings *data.BucketSettings
CopiesNumber uint32
}
PutSettingsParams stores object copy request parameters.
type RangeParams ¶ added in v0.16.0
RangeParams stores range header request parameters.
type ShortInfoParams ¶ added in v0.35.0
ShortInfoParams stores necessary info to get actual obj info in versioned container for non versioned request.
type TestNeoFS ¶ added in v0.22.0
type TestNeoFS struct {
NeoFS
// contains filtered or unexported fields
}
func NewTestNeoFS ¶ added in v0.22.0
func NewTestNeoFS(signer neofscrypto.Signer) *TestNeoFS
func (*TestNeoFS) AllObjects ¶ added in v0.24.0
func (*TestNeoFS) ContainerEACL ¶ added in v0.24.0
func (*TestNeoFS) ContainerID ¶ added in v0.22.0
func (*TestNeoFS) CreateContainer ¶ added in v0.22.0
func (*TestNeoFS) CreateContainerAndSetEACL ¶ added in v0.41.0
func (*TestNeoFS) CreateObject ¶ added in v0.22.0
func (*TestNeoFS) CurrentEpoch ¶ added in v0.22.0
func (*TestNeoFS) DeleteContainer ¶ added in v0.22.0
func (*TestNeoFS) DeleteObject ¶ added in v0.22.0
func (t *TestNeoFS) DeleteObject(ctx context.Context, prm PrmObjectDelete) error
func (*TestNeoFS) FinalizeObjectWithPayloadChecksums ¶ added in v0.30.0
func (*TestNeoFS) IsHomomorphicHashingEnabled ¶ added in v0.30.0
func (*TestNeoFS) MaxObjectSize ¶ added in v0.30.0
func (*TestNeoFS) ReadObject ¶ added in v0.22.0
func (t *TestNeoFS) ReadObject(ctx context.Context, prm PrmObjectRead) (*ObjectPart, error)
func (*TestNeoFS) SearchObjects ¶ added in v0.33.0
SearchObjects searches objects with corresponding filters.
func (*TestNeoFS) SearchObjectsV2 ¶ added in v0.35.0
func (t *TestNeoFS) SearchObjectsV2(_ context.Context, cid cid.ID, filters object.SearchFilters, attributes []string, _ client.SearchObjectsOptions) ([]client.SearchResultItem, error)
SearchObjectsV2 implements neofs.NeoFS interface method.
func (*TestNeoFS) SearchObjectsV2WithCursor ¶ added in v0.35.0
func (t *TestNeoFS) SearchObjectsV2WithCursor(_ context.Context, cid cid.ID, filters object.SearchFilters, attributes []string, cursor string, p client.SearchObjectsOptions) ([]client.SearchResultItem, string, error)
SearchObjectsV2WithCursor implements neofs.NeoFS interface method.
func (*TestNeoFS) SetContainerEACL ¶ added in v0.24.0
func (*TestNeoFS) TimeToEpoch ¶ added in v0.22.0
type UploadCopyParams ¶ added in v0.18.0
type UploadCopyParams struct {
Info *UploadInfoParams
SrcObjInfo *data.ObjectInfo
SrcBktInfo *data.BucketInfo
PartNumber int
Range *RangeParams
}
type UploadData ¶ added in v0.22.0
type UploadInfo ¶ added in v0.18.0
type UploadInfoParams ¶ added in v0.18.0
type UploadInfoParams struct {
UploadID string
Bkt *data.BucketInfo
Key string
Encryption encryption.Params
}
type UploadPartParams ¶ added in v0.18.0
type UploadPartParams struct {
Info *UploadInfoParams
PartNumber int
Size int64
Reader io.Reader
}
type VersionedObject ¶ added in v0.17.0
type VersionedObject struct {
Name string
VersionID string
DeleteMarkVersion string
DeleteMarkerEtag string
Error error
}
VersionedObject stores info about objects to delete.
func (*VersionedObject) String ¶ added in v0.17.0
func (t *VersionedObject) String() string