Documentation
¶
Overview ¶
Package network is a package for defining a network overlay
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Link ¶
type Link interface {
// remote node
Node
// length of link which dictates speed
Length() int
// weight of link which dictates curvature
Weight() int
}
Link is a connection to another node
type Network ¶
type Network interface {
options.Options
// Id of this node
Id() uint64
// Connect to a node
Connect(id uint64) (Link, error)
// Close the network connection
Close() error
// Accept messages on the network
Accept() (*Message, error)
// Send a message to the network
Send(*Message) error
// Retrieve list of connections
Links() ([]Link, error)
}
Network is an interface defining networks or graphs
var ( // TODO: set default network DefaultNetwork Network )
Click to show internal directories.
Click to hide internal directories.