forked from TrueCloudLab/frostfs-node
046206f670
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
24 lines
516 B
Go
24 lines
516 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/engine"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
type localHeader struct {
|
|
storage *engine.StorageEngine
|
|
}
|
|
|
|
func (h *localHeader) head(ctx context.Context, prm *Prm, handler func(*object.Object)) error {
|
|
head, err := engine.Head(h.storage, prm.addr)
|
|
if err != nil {
|
|
return errors.Wrapf(err, "(%T) could not get header from local storage", h)
|
|
}
|
|
|
|
handler(head)
|
|
|
|
return nil
|
|
}
|