Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group interface { // Name of the group, can be used for debugging Name() string // Join this group Join() error // Leave this group Leave() error // Broadcast a message to all nodes in this group Broadcast(messageType string, data interface{}) error Messages() chan *Message NotifyNodeAvailable(c chan *Node) chan *Node }
Group within the network
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message received from a Node in the network.
type Network ¶
type Network struct { }
func (*Network) NotifyNodeAvailable ¶
func (*Network) NotifyNodeUnavailable ¶
type Node ¶
type Node struct { }
func (*Node) Messages ¶
Messages returns a channel that can be used to listen to all incoming data from this specific node
func (*Node) NotifyUnavailable ¶
NotifyUnavailable takes a channel that will be notified when this node is no longer available in the network. When this occurs this node should be discarded - it will not be reused
Click to show internal directories.
Click to hide internal directories.