forked from TrueCloudLab/frostfs-node
c0aa892161
Replace meta Bucket with meta.DB instance in local storage implementation. Adopt all dependent components to new local storage. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
24 lines
510 B
Go
24 lines
510 B
Go
package headsvc
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/core/object"
|
|
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/localstore"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
type localHeader struct {
|
|
storage *localstore.Storage
|
|
}
|
|
|
|
func (h *localHeader) head(ctx context.Context, prm *Prm, handler func(*object.Object)) error {
|
|
head, err := h.storage.Head(prm.addr)
|
|
if err != nil {
|
|
return errors.Wrapf(err, "(%T) could not get header from local storage", h)
|
|
}
|
|
|
|
handler(head)
|
|
|
|
return nil
|
|
}
|