Documentation
¶
Index ¶
Constants ¶
View Source
const ( LogDisable = iota LogError LogInfo LogDebug )
Log levels
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Election ¶
type Election struct { Client *api.Client // Consul client Checks []string // Slice of associated health checks Kv string // Key in Consul kv CheckTimeout time.Duration SessionLockDelay time.Duration LogPrefix string // Prefix for a log Event Notifier sync.RWMutex // contains filtered or unexported fields }
Election implements to detect a leader in a cluster of services
func (*Election) InitContext ¶ added in v1.2.0
InitContext starting election process with context
func (*Election) SetLogLevel ¶
SetLogLevel is setting level according constants LogDisable|LogError|LogInfo|LogDebug
type ElectionConfig ¶ added in v1.0.0
type ElectionConfig struct { Client *api.Client // Consul client Checks []string // Slice of associated health checks Key string // Key in Consul KV LogLevel uint8 // Log level LogDisable|LogError|LogInfo|LogDebug LogPrefix string // Prefix for a log Event Notifier CheckTimeout time.Duration SessionLockDelay time.Duration }
ElectionConfig config for Election
Click to show internal directories.
Click to hide internal directories.