[#176] localstore: Implement shard methods via Metabase and BlobStor

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-17 20:39:43 +03:00 committed by Alex Vanin
parent b127607ac6
commit 46e455dcae
6 changed files with 154 additions and 8 deletions

View file

@ -0,0 +1,21 @@
package meta
import (
"github.com/nspcc-dev/neofs-api-go/pkg/object"
"github.com/pkg/errors"
)
// Exists checks if object is presented in metabase.
func (db *DB) Exists(addr *object.Address) (bool, error) {
// FIXME: temp solution, avoid direct Get usage
_, err := db.Get(addr)
if err != nil {
if errors.Is(err, errNotFound) {
return false, nil
}
return false, err
}
return true, nil
}