Documentation
¶
Index ¶
- type APIMessageID
- type APIUpdateID
- type Distance
- type InitialNodeState
- type InitialStateMsg
- type Node
- type NodeAdded
- type NodeRemoved
- type NodeState
- type PeerAdded
- type PeerInfo
- type PeerRemoved
- type RootAnnouncement
- type RootState
- type SimEvent
- type SimEventMsg
- type Simulator
- func (sim *Simulator) CalculateShortestPaths(nodes map[string]struct{}, wires map[string]map[string]bool)
- func (sim *Simulator) ConnectNodes(a, b string) error
- func (sim *Simulator) CreateNode(t string) error
- func (sim *Simulator) DisconnectNodes(a, b string) error
- func (sim *Simulator) Distances() map[string]map[string]*Distance
- func (sim *Simulator) Node(t string) *Node
- func (sim *Simulator) Nodes() map[string]*Node
- func (sim *Simulator) PingSNEK(from, to string) (uint16, time.Duration, error)
- func (sim *Simulator) PingTree(from, to string) (uint16, time.Duration, error)
- func (sim *Simulator) PingingEnabled() bool
- func (sim *Simulator) ReportDistance(a, b string, l int64, snek bool)
- func (sim *Simulator) SNEKPathConvergence() map[string]map[string]bool
- func (sim *Simulator) StartNodeEventHandler(t string)
- func (sim *Simulator) TreePathConvergence() map[string]map[string]bool
- func (sim *Simulator) Uptime() time.Duration
- type SnakeAscUpdate
- type SnakeDescUpdate
- type State
- type StateAccessor
- type StateUpdateMsg
- type TreeParentUpdate
- type TreeRootAnnUpdate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIMessageID ¶ added in v0.6.0
type APIMessageID int
const ( UnknownMessage APIMessageID = iota SimInitialState SimUpdate )
type APIUpdateID ¶ added in v0.6.0
type APIUpdateID int
const ( UnknownUpdate APIUpdateID = iota SimNodeAdded SimNodeRemoved SimPeerAdded SimPeerRemoved SimTreeParentUpdated SimSnakeAscUpdated SimSnakeDescUpdated SimTreeRootAnnUpdated )
type InitialNodeState ¶ added in v0.6.0
type InitialStateMsg ¶ added in v0.6.0
type InitialStateMsg struct {
MsgID APIMessageID
Nodes map[string]InitialNodeState
End bool
}
type NodeRemoved ¶ added in v0.6.0
type NodeRemoved struct {
Node string
}
type NodeState ¶ added in v0.6.0
type NodeState struct {
PeerID string
Connections map[int]string
Parent string
Coords []uint64
Announcement RootAnnouncement
AscendingPeer string
AscendingPathID string
DescendingPeer string
DescendingPathID string
}
func NewNodeState ¶ added in v0.6.0
type PeerRemoved ¶ added in v0.6.0
type RootAnnouncement ¶ added in v0.6.0
type SimEvent ¶ added in v0.6.0
type SimEvent interface {
// contains filtered or unexported methods
}
type SimEventMsg ¶ added in v0.6.0
type SimEventMsg struct {
UpdateID APIUpdateID
Event SimEvent
}
type Simulator ¶
type Simulator struct {
State *StateAccessor
// contains filtered or unexported fields
}
func (*Simulator) CalculateShortestPaths ¶
func (*Simulator) ConnectNodes ¶
func (*Simulator) CreateNode ¶
func (*Simulator) DisconnectNodes ¶
func (*Simulator) PingingEnabled ¶ added in v0.4.0
func (*Simulator) ReportDistance ¶
func (*Simulator) SNEKPathConvergence ¶ added in v0.2.0
func (*Simulator) StartNodeEventHandler ¶ added in v0.6.0
func (*Simulator) TreePathConvergence ¶ added in v0.2.0
type SnakeAscUpdate ¶ added in v0.6.0
type SnakeDescUpdate ¶ added in v0.6.0
type StateAccessor ¶ added in v0.6.0
func NewStateAccessor ¶ added in v0.6.0
func NewStateAccessor() *StateAccessor
func (*StateAccessor) GetLinkCount ¶ added in v0.6.0
func (s *StateAccessor) GetLinkCount() float64
func (*StateAccessor) GetNodeCoords ¶ added in v0.6.0
func (s *StateAccessor) GetNodeCoords(name string) []uint64
func (*StateAccessor) GetNodeName ¶ added in v0.6.0
func (s *StateAccessor) GetNodeName(peerID string) (string, error)
func (*StateAccessor) Subscribe ¶ added in v0.6.0
func (s *StateAccessor) Subscribe(ch chan<- SimEvent) State
type StateUpdateMsg ¶ added in v0.6.0
type StateUpdateMsg struct {
MsgID APIMessageID
Event SimEventMsg
}
type TreeParentUpdate ¶ added in v0.6.0
Click to show internal directories.
Click to hide internal directories.