forked from TrueCloudLab/frostfs-node
Alex Vanin
20de74a505
Due to source code relocation from GitHub. Signed-off-by: Alex Vanin <a.vanin@yadro.com>
32 lines
766 B
Go
32 lines
766 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.Context) (Iterator, error) {
|
|
return s.i, nil
|
|
}
|
|
|
|
func (s storageWrapper) InitWriter(common.Context) (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,
|
|
}
|
|
}
|