forked from TrueCloudLab/frostfs-node
46e455dcae
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
21 lines
406 B
Go
21 lines
406 B
Go
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
|
|
}
|