[#1559] metabase: Remove public functions

Reduce public interface of this package. Later each result will contain
an additional status, so it makes more sense to use the same functions
and result processing everywhere.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-07-12 17:42:55 +03:00 committed by fyrchik
parent 30c7925b3c
commit f58234aa2f
31 changed files with 234 additions and 247 deletions

View file

@ -60,7 +60,10 @@ func (s *Shard) Put(prm PutPrm) (PutRes, error) {
}
// put to metabase
if err := meta.Put(s.metaBase, prm.obj, res.BlobovniczaID()); err != nil {
var pPrm meta.PutPrm
pPrm.WithObject(prm.obj)
pPrm.WithBlobovniczaID(res.BlobovniczaID())
if _, err := s.metaBase.Put(pPrm); err != nil {
// may we need to handle this case in a special way
// since the object has been successfully written to BlobStor
return PutRes{}, fmt.Errorf("could not put object to metabase: %w", err)