[#186] localstorage: Implement utility functions over StorageEngine

Implement Put/Get/GetRange/Select/SelectAll functions over storage
engine. These functions are going to be used by Object service.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-19 11:15:49 +03:00 committed by Alex Vanin
parent 70a65c5aff
commit 9a4cd01eb8
4 changed files with 63 additions and 0 deletions

View file

@ -89,3 +89,12 @@ func (e *StorageEngine) objectExists(obj *object.Object, shards []*shard.Shard)
return exists
}
// Put writes provided object to local storage.
func Put(storage *StorageEngine, obj *object.Object) error {
_, err := storage.Put(new(PutPrm).
WithObject(obj),
)
return err
}