Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Running is the state that server will be set to when online Running = iota // Stopped is the state that server will be set to when offline Stopped = iota )
Variables ¶
This section is empty.
Functions ¶
func GenerateUniqueID ¶
func GenerateUniqueID() string
GenerateUniqueID returns a cluster compliant unique server id
Types ¶
type Base ¶
type Base struct { Master string ID string State int ElectionLock sync.Mutex Emitter *communication.Emitter HeartbeatPause time.Duration }
Base is a single entity
func New ¶
func New(e *communication.Emitter, heartbeatPause time.Duration) *Base
New will create a cluster with the specified number of servers
func (*Base) MarshalJSON ¶ added in v1.0.0
MarshalJSON retrieves the target server as a json string
Click to show internal directories.
Click to hide internal directories.