Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultHeartbeatFrequency = time.Second * 1 DefaultVersion = "unset" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Master ¶
type Master interface {
Start() error
Stop() error
IsMaster() bool
ID() string
Status() (interface{}, error)
}
func New ¶
func New(cfg *MasterConfig) Master
type MasterConfig ¶
type MasterConfig struct {
// Required: Backend that will be used for master election
MasterLock backend.MasterLock
// Optional: How often should a master send heartbeats (default: */1s)
HeartBeatFrequency time.Duration
// Optional: StartHook func is called as soon as a master lock is achieved.
// It is the callback to signal becoming a master
StartHook func()
// Optional: StopHook func is called when the master lock is lost
// It is the callback to signal that it is no longer the master.
// It is not called when the master is stopped manually
StopHook func()
// Optional: Error channel to receive go-master related error messages
Err chan error
// Optional: Logger for go-master to use (default: new logrus shim will be created)
Logger log.Logger
// Optional: If set, workers will NOT perform any work if the master's
// version differs from their own version. (default: "unset")
Version string
}
Directories
¶
| Path | Synopsis |
|---|---|
|
mysql
database initialization functionality
|
database initialization functionality |
|
fakes
|
|
|
fakebackend
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
fakemaster
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
syncfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
Click to show internal directories.
Click to hide internal directories.