Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultName is default network name DefaultName = "go.micro" // DefaultAddress is default network address DefaultAddress = ":0" // AnnounceTime defines time interval to periodically announce node neighbours AnnounceTime = 1 * time.Second // KeepAliveTime is the time in which we want to have sent a message to a peer KeepAliveTime = 30 * time.Second // SyncTime is the time a network node requests full sync from the network SyncTime = 1 * time.Minute // PruneTime defines time interval to periodically check nodes that need to be pruned // due to their not announcing their presence within this time interval PruneTime = 90 * time.Second // MaxDepth defines max depth of peer topology MaxDepth uint = 3 // NetworkChannel is the name of the tunnel channel for passing network messages NetworkChannel = "network" // ControlChannel is the name of the tunnel channel for passing control message ControlChannel = "control" // DefaultLink is default network link DefaultLink = "network" // MaxConnections is the max number of network client connections MaxConnections = 3 // MaxPeerErrors is the max number of peer errors before we remove it from network graph MaxPeerErrors = 3 // ErrPeerExists is returned when adding a peer which already exists ErrPeerExists = errors.New("peer already exists") // ErrPeerNotFound is returned when a peer could not be found in node topology ErrPeerNotFound = errors.New("peer not found") // ErrClientNotFound is returned when client for tunnel channel could not be found ErrClientNotFound = errors.New("client not found") // ErrPeerLinkNotFound is returned when peer link could not be found in tunnel Links ErrPeerLinkNotFound = errors.New("peer link not found") // ErrPeerMaxExceeded is returned when peer has reached its max error count limit ErrPeerMaxExceeded = errors.New("peer max errors exceeded") )
Functions ¶
func NewNetwork ¶
NewNetwork returns a new network node
func PeersToProto ¶
PeersToProto returns node peers graph encoded into protobuf
func ProtoToRoute ¶
ProtoToRoute decodes protobuf route into router route and returns it
func RouteToProto ¶
RouteToProto encodes route into protobuf and returns it
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.