routes

package
v0.0.0-...-79ba347 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder represents component that routes node to its managers.

For correct operation, Builder must be created using the constructor (New) based on the required parameters and optional components. After successful creation, the Builder is immediately ready to work through API.

func New

func New(prm Prm) *Builder

New creates a new instance of the Builder.

Panics if at least one value of the parameters is invalid.

The created Builder does not require additional initialization and is completely ready for work.

func (*Builder) NextStage

func (b *Builder) NextStage(epoch uint64, t reputation.Trust, passed []common.ServerInfo) ([]common.ServerInfo, error)

NextStage builds Manager list for trusted node and returns it directly.

If passed route has more than one point, then endpoint of the route is reached.

type Prm

type Prm struct {
	// Manager builder for current node.
	//
	// Must not be nil.
	ManagerBuilder common.ManagerBuilder

	Log *logger.Logger
}

Prm groups the required parameters of the Builder's constructor.

All values must comply with the requirements imposed on them. Passing incorrect parameter values will result in constructor failure (error or panic depending on the implementation).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL