Versions in this module Expand all Collapse all v0 v0.2.0 Jan 8, 2017 v0.1.0 Jan 8, 2017 Changes in this version + const DefaultHeartbeatMillis + const DefaultInitialHosts + const DefaultListenPort + const DefaultMaxBroadcastBytes + const EnvVarHeartbeatMillis + const EnvVarInitialHosts + const EnvVarListenPort + const EnvVarMaxBroadcastBytes + func AddBroadcastListener(listener BroadcastListener) + func AddStatusListener(listener StatusListener) + func Begin() + func BroadcastBytes(bytes []byte) error + func BroadcastString(str string) error + func GetHeartbeatMillis() int + func GetInitialHosts() []string + func GetListenPort() int + func GetLocalIP() (net.IP, error) + func GetMaxBroadcastBytes() int + func GetNowInMillis() uint32 + func PingNode(node *Node) error + func SetHeartbeatMillis(val int) + func SetListenPort(val int) + func SetLogThreshold(level LogLevel) + func SetMaxBroadcastBytes(val int) + func UpdateNodeStatus(node *Node, status NodeStatus) + type Broadcast struct + func (b *Broadcast) Bytes() []byte + func (b *Broadcast) Index() uint32 + func (b *Broadcast) Label() string + func (b *Broadcast) Origin() *Node + type BroadcastListener interface + OnBroadcast func(broadcast *Broadcast) + type LogLevel byte + const LogAll + const LogDebug + const LogError + const LogFatal + const LogInfo + const LogOff + const LogTrace + const LogWarn + func (s LogLevel) String() string + type Node struct + func AddNode(node *Node) (*Node, error) + func AllNodes() []*Node + func CreateNodeByAddress(address string) (*Node, error) + func CreateNodeByIP(ip net.IP, port uint16) (*Node, error) + func HealthyNodes() []*Node + func RemoveNode(node *Node) (*Node, error) + func (n *Node) Address() string + func (n *Node) Age() uint32 + func (n *Node) EmitCounter() int8 + func (n *Node) IP() net.IP + func (n *Node) Port() uint16 + func (n *Node) Status() NodeStatus + func (n *Node) Timestamp() uint32 + func (n *Node) Touch() + type NodeStatus byte + const StatusAlive + const StatusDead + const StatusForwardTo + const StatusUnknown + func (s NodeStatus) String() string + type StatusListener interface + OnChange func(node *Node, status NodeStatus)