[#413] Use tree service to put object

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-05-17 17:56:05 +03:00 committed by Alex Vanin
parent ab5c44ac14
commit 36f3c43af5
4 changed files with 201 additions and 46 deletions

View file

@ -29,6 +29,29 @@ type TreeService interface {
PutBucketCORS(ctx context.Context, cnrID *cid.ID, objID *oid.ID) (*oid.ID, error)
// DeleteBucketCORS removes a node from a system tree and returns objID which must be deleted in NeoFS
DeleteBucketCORS(ctx context.Context, cnrID *cid.ID) (*oid.ID, error)
GetVersions(ctx context.Context, cnrID *cid.ID, objectName string) ([]*NodeVersion, error)
//GetUnversioned(context.Context, *cid.ID, string) (*NodeVersion, error)
AddVersion(ctx context.Context, cnrID *cid.ID, objectName string, newVersion *NodeVersion) error
RemoveVersion(ctx context.Context, cnrID *cid.ID, nodeID uint64) error
AddSystemVersion(ctx context.Context, cnrID *cid.ID, objectName string, newVersion *BaseNodeVersion) error
RemoveSystemVersion(ctx context.Context, cnrID *cid.ID, nodeID uint64) error
}
type NodeVersion struct {
BaseNodeVersion
IsDeleteMarker bool
IsUnversioned bool
}
type BaseNodeVersion struct {
ID uint64
OID *oid.ID
}
// ErrNodeNotFound is returned from Tree service in case of not found error.