2020-10-02 12:23:52 +00:00
|
|
|
package v2
|
|
|
|
|
|
|
|
import (
|
2023-03-13 11:37:35 +00:00
|
|
|
"context"
|
2020-10-02 12:23:52 +00:00
|
|
|
"io"
|
|
|
|
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/engine"
|
|
|
|
objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
|
|
|
|
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
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
|
|
|
}
|
|
|
|
|
2023-03-13 11:37:35 +00:00
|
|
|
func (s *localStorage) Head(ctx context.Context, addr oid.Address) (*objectSDK.Object, error) {
|
2020-10-02 12:23:52 +00:00
|
|
|
if s.ls == nil {
|
|
|
|
return nil, io.ErrUnexpectedEOF
|
|
|
|
}
|
|
|
|
|
2023-03-13 11:37:35 +00:00
|
|
|
return engine.Head(ctx, s.ls, addr)
|
2020-10-02 12:23:52 +00:00
|
|
|
}
|