Documentation
¶
Index ¶
- Constants
- func LinksCentralized(node nom.UID, ctx bh.RcvContext) (links []nom.Link)
- func NodesCentralized(ctx bh.RcvContext) (nodes []nom.UID)
- func RegisterDiscovery(h bh.Hive)
- func ShortestPathCentralized(from, to nom.UID, ctx bh.RcvContext) (paths [][]nom.Link, length int)
- type GraphBuilderCentralized
- type NewLink
Constants ¶
const (
GraphDict = "NetGraph"
)
Variables ¶
This section is empty.
Functions ¶
func LinksCentralized ¶
LinksCentralized returns links of node.
Note that this method should be used only when the GraphBuilderCentralized is in use.
func NodesCentralized ¶
func NodesCentralized(ctx bh.RcvContext) (nodes []nom.UID)
NodesCentralized returns the nodes with outgoing links so far.
Note that this methods should be used only when the GraphBuilderCentralized is in use.
func RegisterDiscovery ¶
RegisterDiscovery registers the handlers for topology discovery on the hive.
func ShortestPathCentralized ¶
ShortestPathCentralized calculates the shortest path from node "from" to node "to" according to the state stored in GraphDict by the GraphBuilderCentralized.
This method is not go-routine safe and must be called within a handler of the application that uses the GraphBuilderCentralized as a handler. Otherwise, the user needs to synchronize the two.
Types ¶
type GraphBuilderCentralized ¶
type GraphBuilderCentralized struct{}
GraphBuilderCentralized is a handler that builds a centralized graph of the network topology. This handler is only useful for centralized applications.
func (GraphBuilderCentralized) Map ¶
func (b GraphBuilderCentralized) Map(msg bh.Msg, ctx bh.MapContext) bh.MappedCells
func (GraphBuilderCentralized) Rcv ¶
func (b GraphBuilderCentralized) Rcv(msg bh.Msg, ctx bh.RcvContext) error