[#488] reputation/managers: Implement route builders

Add implementation of Builder interface for
intermediate trusts. Move all code associated
with managers to `common` directory in `cmd`
and `pkg/services/reputation`

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-04-22 17:56:25 +03:00 committed by Alex Vanin
parent 6ffc109a75
commit 49d477f466
9 changed files with 106 additions and 31 deletions

View file

@ -5,6 +5,7 @@ import (
"io"
"github.com/nspcc-dev/neofs-node/pkg/services/reputation"
"github.com/nspcc-dev/neofs-node/pkg/services/reputation/common/router"
)
// Context wraps stdlib context
@ -53,3 +54,11 @@ type WriterProvider interface {
// contexts, so specific ones may document their own behavior.
InitWriter(Context) (Writer, error)
}
// ManagerBuilder defines an interface for providing a list
// of Managers for specific epoch. Implementation depends on trust value.
type ManagerBuilder interface {
// BuildManagers must compose list of managers. It depends on
// particular epoch and PeerID of the current route point.
BuildManagers(epoch uint64, p reputation.PeerID) ([]router.ServerInfo, error)
}