2020-10-02 12:23:52 +00:00
|
|
|
package v2
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
2020-11-19 08:38:50 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
|
2022-02-11 12:25:05 +00:00
|
|
|
objectSDK "github.com/nspcc-dev/neofs-sdk-go/object"
|
2022-01-26 12:11:13 +00:00
|
|
|
objectSDKAddress "github.com/nspcc-dev/neofs-sdk-go/object/address"
|
2020-10-02 12:23:52 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type localStorage struct {
|
2020-11-19 08:38:50 +00:00
|
|
|
ls *engine.StorageEngine
|
2020-10-02 12:23:52 +00:00
|
|
|
}
|
|
|
|
|
2022-02-11 12:25:05 +00:00
|
|
|
func (s *localStorage) Head(addr *objectSDKAddress.Address) (*objectSDK.Object, error) {
|
2020-10-02 12:23:52 +00:00
|
|
|
if s.ls == nil {
|
|
|
|
return nil, io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
|
2020-11-19 08:38:50 +00:00
|
|
|
return engine.Head(s.ls, addr)
|
2020-10-02 12:23:52 +00:00
|
|
|
}
|