frostfs-node/pkg/services/reputation/local/controller/util.go
Dmitrii Stepanov 7ebbfa3358 [#212] reputationsvc: Resolve linters and rename
Resolved containedctx linters.
Renamed context structs and interfaces to more understandble names.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-04-07 15:35:57 +00:00

32 lines
778 B
Go

package trustcontroller
import "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/reputation/common"
type storageWrapper struct {
w common.Writer
i Iterator
}
func (s storageWrapper) InitIterator(common.EpochProvider) (Iterator, error) {
return s.i, nil
}
func (s storageWrapper) InitWriter(common.EpochProvider) (common.Writer, error) {
return s.w, nil
}
// SimpleIteratorProvider returns IteratorProvider that provides
// static context-independent Iterator.
func SimpleIteratorProvider(i Iterator) IteratorProvider {
return &storageWrapper{
i: i,
}
}
// SimpleWriterProvider returns WriterProvider that provides
// static context-independent Writer.
func SimpleWriterProvider(w common.Writer) common.WriterProvider {
return &storageWrapper{
w: w,
}
}