[#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:
parent
70a65c5aff
commit
9a4cd01eb8
4 changed files with 63 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue