discovery

package
v0.0.0-...-8b36eab Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2016 License: GPL-2.0 Imports: 13 Imported by: 3

Documentation

Overview

* +=============================================== * | Author: Elahe Jalalpour (el.jalalpour@gmail.com) * | * | Creation Date: 24-11-2015 * | * | File Name: arp.go * +===============================================

* +=============================================== * | Author: Elahe Jalalpour (el.jalalpour@gmail.com) * | * | Creation Date: 24-11-2015 * | * | File Name: bh.go * +===============================================

* +=============================================== * | Author: Elahe Jalalpour (el.jalalpour@gmail.com) * | * | Creation Date: 24-11-2015 * | * | File Name: host.go * +===============================================

Index

Constants

View Source
const (
	GraphDict = "NetGraph"
)

Variables

This section is empty.

Functions

func LinksCentralized

func LinksCentralized(node nom.UID, ctx bh.RcvContext) (links []nom.Link)

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

func RegisterDiscovery(h bh.Hive)

RegisterDiscovery registers the discovery module for topology discovery on the hive. you can use it's REST API in order to communicate with it.

func ShortestPathCentralized

func ShortestPathCentralized(from, to nom.UID, ctx bh.RcvContext) (
	paths [][]nom.Link, length int)

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 (GraphBuilderCentralized) Rcv

func (b GraphBuilderCentralized) Rcv(msg bh.Msg, ctx bh.RcvContext) error
type NewLink nom.Link

Jump to

Keyboard shortcuts

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