2021-03-23 18:28:05 +00:00
|
|
|
package trustcontroller
|
|
|
|
|
|
|
|
import (
|
2023-03-07 13:38:26 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/reputation"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/reputation/common"
|
2021-03-23 18:28:05 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Iterator is a group of methods provided by entity
|
|
|
|
// which can iterate over a group of reputation.Trust values.
|
|
|
|
type Iterator interface {
|
|
|
|
// Iterate must start an iterator over all trust values.
|
|
|
|
// For each value should call a handler, the error
|
|
|
|
// of which should be directly returned from the method.
|
|
|
|
//
|
|
|
|
// Internal failures of the iterator are also signaled via
|
|
|
|
// an error. After a successful call to the last value
|
|
|
|
// handler, nil should be returned.
|
|
|
|
Iterate(reputation.TrustHandler) error
|
|
|
|
}
|
|
|
|
|
|
|
|
// IteratorProvider is a group of methods provided
|
|
|
|
// by entity which generates iterators over
|
|
|
|
// reputation.Trust values.
|
|
|
|
type IteratorProvider interface {
|
|
|
|
// InitIterator should return an initialized Iterator
|
|
|
|
// that iterates over values from IteratorContext.Epoch() epoch.
|
|
|
|
//
|
|
|
|
// Initialization problems are reported via error.
|
|
|
|
// If no error was returned, then the Iterator must not be nil.
|
|
|
|
//
|
|
|
|
// Implementations can have different logic for different
|
|
|
|
// contexts, so specific ones may document their own behavior.
|
2023-04-05 07:44:40 +00:00
|
|
|
InitIterator(common.EpochProvider) (Iterator, error)
|
2021-03-23 18:28:05 +00:00
|
|
|
}
|