Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ElectionCallback ¶
type ElectionCallback func(*Elector)
type Elector ¶
type Elector struct { IsLeader bool IsRunning bool ElectionName string Me string // contains filtered or unexported fields }
func NewElector ¶
func NewElector(electionName string, me string, onElectedCallback ElectionCallback) (*Elector, error)
func (*Elector) StopElection ¶
func (el *Elector) StopElection()
type Heartbeat ¶
type Heartbeat struct { ServiceName string // contains filtered or unexported fields }
func RegisterHeartbeat ¶
func RegisterHeartbeat(serviceName string, timeout time.Duration, regData string, onConnectCallback HeartbeatEventCallback, onDisConnectCallback HeartbeatEventCallback) (*Heartbeat, error)
func (*Heartbeat) Disconnect ¶
func (hb *Heartbeat) Disconnect()
type HeartbeatEventCallback ¶
Click to show internal directories.
Click to hide internal directories.