From 2ba4ebc8c971088e9396fa11f36482cf4108cd10 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 24 Nov 2020 17:02:41 +0300 Subject: [PATCH] [#211] blobstor: Implement no-op GetSmall operation Signed-off-by: Leonard Lyubich --- .../blobstor/get_small.go | 27 +++++++++++++++++++ pkg/local_object_storage/blobstor/util.go | 19 +++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 pkg/local_object_storage/blobstor/get_small.go diff --git a/pkg/local_object_storage/blobstor/get_small.go b/pkg/local_object_storage/blobstor/get_small.go new file mode 100644 index 00000000..667daf89 --- /dev/null +++ b/pkg/local_object_storage/blobstor/get_small.go @@ -0,0 +1,27 @@ +package blobstor + +import ( + "github.com/pkg/errors" +) + +// GetSmallPrm groups the parameters of GetSmallPrm operation. +type GetSmallPrm struct { + address + rwBlobovniczaID +} + +// GetBigRes groups resulting values of GetBig operation. +type GetSmallRes struct { + roObject +} + +// GetSmall reads the object from blobovnicza of BLOB storage by address. +// +// If blobovnicza ID is not set or set to nil, BlobStor tries to get object +// from any blobovnicza. +// +// Returns any error encountered that +// did not allow to completely read the object. +func (b *BlobStor) GetSmall(prm *GetSmallPrm) (*GetSmallRes, error) { + return nil, errors.New("method GetSmall is not implemented yet") +} diff --git a/pkg/local_object_storage/blobstor/util.go b/pkg/local_object_storage/blobstor/util.go index 507973a2..86bf23cf 100644 --- a/pkg/local_object_storage/blobstor/util.go +++ b/pkg/local_object_storage/blobstor/util.go @@ -3,6 +3,7 @@ package blobstor import ( objectSDK "github.com/nspcc-dev/neofs-api-go/pkg/object" "github.com/nspcc-dev/neofs-node/pkg/core/object" + "github.com/nspcc-dev/neofs-node/pkg/local_object_storage/blobovnicza" ) type address struct { @@ -31,3 +32,21 @@ type rwObject struct { func (o *rwObject) SetObject(obj *object.Object) { o.obj = obj } + +type roBlobovniczaID struct { + blobovniczaID *blobovnicza.ID +} + +// BlobovniczaID returns blobovnicza ID. +func (v roBlobovniczaID) BlobovniczaID() *blobovnicza.ID { + return v.blobovniczaID +} + +type rwBlobovniczaID struct { + roBlobovniczaID +} + +// SetBlobovniczaID sets blobovnicza ID. +func (v *rwBlobovniczaID) SetBlobovniczaID(id *blobovnicza.ID) { + v.blobovniczaID = id +}