Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRedisPool ¶
Types ¶
type DistLocker ¶
DistLocker abstracts a distributed locker.
type Kettle ¶
type Kettle struct {
// contains filtered or unexported fields
}
Kettle provides functions that abstract the master election of a group of workers at a given interval time.
func (*Kettle) Start ¶
func (k *Kettle) Start(in *StartInput) error
Start starts Kettle's main function.
type KettleOption ¶
type KettleOption interface {
Apply(*Kettle)
}
KettleOption configures Kettle.
func WithDistLocker ¶
func WithDistLocker(v DistLocker) KettleOption
WithDistLocker configures a Kettle instance's DistLocker.
func WithTickTime ¶
func WithTickTime(v int64) KettleOption
WithTickTime configures a Kettle instance's tick timer in seconds.
func WithVerbose ¶
func WithVerbose(v bool) KettleOption
WithVerbose configures a Kettle instance's log verbosity.
type StartInput ¶
type StartInput struct { Master func(ctx interface{}) error // function to call every time we are master MasterCtx interface{} // callback function parameter Quit chan error // signal for us to terminate Done chan error // report that we are done }
StartInput configures the Start function.
Click to show internal directories.
Click to hide internal directories.