traffic

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoNodeFound = errors.New("can't find any available nodes for target action")
)

Functions

This section is empty.

Types

type Manager

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

Manager struct

func NewManager

func NewManager(nodeID *types.NodeID) Manager

NewManager creates new Manager struct

func (*Manager) AddDestination

func (m *Manager) AddDestination(nodeID types.NodeID, versionedName types.NodeVersionName, blockName types.BlockName, actions []types.ActionName) error

AddDestination adds information about topology of known nodes to manager

func (*Manager) DestinationExist

func (m *Manager) DestinationExist(targetAction types.TargetAction) bool

DestinationExist return true if target action is found in the network

func (*Manager) Destinations

func (m *Manager) Destinations() Destinations

Destinations returns network topology

func (*Manager) GetDeliveryTargetNodeID added in v0.1.2

func (m *Manager) GetDeliveryTargetNodeID(deliveryMethod types.DeliveryMethod, targetAction types.TargetAction) (*types.NodeID, error)

GetDeliveryTargetNodeID return NodeID for target action based on set deliveryMethod in config file

func (*Manager) Nodes

func (m *Manager) Nodes() Nodes

Nodes returns array of known node ID's

func (*Manager) RemoveNodeID

func (m *Manager) RemoveNodeID(nodeID types.NodeID)

RemoveNodeID removes node id from all mentions in the topology

func (*Manager) UpdateLastSeen

func (m *Manager) UpdateLastSeen(nodeID types.NodeID)

type Nodes

type Nodes map[types.NodeID]time.Time

Jump to

Keyboard shortcuts

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