forked from TrueCloudLab/frostfs-node
91825a0162
Implement reputation `Router` and its constructor, designed to define where to send local trusts. Router is based on dependencies that are hidden behind interfaces, that are declared in the router's package. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
29 lines
794 B
Go
29 lines
794 B
Go
package reputationroute
|
|
|
|
import (
|
|
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
|
|
}
|
|
|
|
// 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)
|
|
}
|