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.
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 WithLogger ¶ added in v2.2.0
func WithLogger(v *log.Logger) KettleOption
WithLogger sets the logger option.
func WithNodeName ¶ added in v2.3.0
func WithNodeName(v string) KettleOption
WithName configures Kettle instance's name.
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 }
StartInput configures the Start function.
Click to show internal directories.
Click to hide internal directories.