diff --git a/pkg/services/container/announcement/load/controller/util.go b/pkg/services/container/announcement/load/controller/util.go index df1ca7032..4b13c8f0d 100644 --- a/pkg/services/container/announcement/load/controller/util.go +++ b/pkg/services/container/announcement/load/controller/util.go @@ -1,9 +1,38 @@ package loadcontroller -import "github.com/nspcc-dev/neofs-api-go/pkg/container" +import ( + "context" + + "github.com/nspcc-dev/neofs-api-go/pkg/container" +) func usedSpaceFilterEpochEQ(epoch uint64) UsedSpaceFilter { return func(a container.UsedSpaceAnnouncement) bool { return a.Epoch() == epoch } } + +type storageWrapper struct { + w Writer + i Iterator +} + +func (s storageWrapper) InitIterator(context.Context) (Iterator, error) { + return s.i, nil +} + +func (s storageWrapper) InitWriter(context.Context) (Writer, error) { + return s.w, nil +} + +func SimpleIteratorProvider(i Iterator) IteratorProvider { + return &storageWrapper{ + i: i, + } +} + +func SimpleWriterProvider(w Writer) WriterProvider { + return &storageWrapper{ + w: w, + } +}