5970a5e6ae
Declare interfaces for building list of managers of certain peer in certain epoch. Implement `Builder` struct that aggregates fields that are necessary for building list of managers. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
42 lines
1.3 KiB
Go
42 lines
1.3 KiB
Go
package reputationroute
|
|
|
|
import (
|
|
"github.com/nspcc-dev/neofs-node/pkg/services/reputation"
|
|
reputationcontroller "github.com/nspcc-dev/neofs-node/pkg/services/reputation/local/controller"
|
|
)
|
|
|
|
// ServerInfo describes a set of
|
|
// characteristics of a point in a route.
|
|
type ServerInfo interface {
|
|
// PublicKey returns public key of the node
|
|
// from the route in a binary representation.
|
|
PublicKey() []byte
|
|
|
|
// Returns network address of the node
|
|
// in the route.
|
|
//
|
|
// Can be empty.
|
|
Address() string
|
|
}
|
|
|
|
// Builder groups methods to route values in the network.
|
|
type Builder interface {
|
|
// NextStage must return next group of route points
|
|
// for passed epoch and PeerID of the current route point.
|
|
// Implementation must take into account already passed route points.
|
|
//
|
|
// Empty passed list means being at the starting point of the route.
|
|
//
|
|
// Must return empty list and no error if the endpoint of the route is reached.
|
|
NextStage(epoch uint64, p reputation.PeerID, passed []ServerInfo) ([]ServerInfo, error)
|
|
}
|
|
|
|
// RemoteWriterProvider describes the component
|
|
// for sending values to a fixed route point.
|
|
type RemoteWriterProvider interface {
|
|
// InitRemote must return WriterProvider to the route point
|
|
// corresponding to info.
|
|
//
|
|
// Nil info matches the end of the route.
|
|
InitRemote(info ServerInfo) (reputationcontroller.WriterProvider, error)
|
|
}
|