Documentation ¶ Index ¶ type Lock func (l *Lock) Run(key string, timeout time.Duration, handler func() error) type Locker func New(opts ...Option) Locker type Option func Logger(l logger.Logger) Option func Redis(r *redis.Client) Option type Options Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Lock ¶ type Lock struct { // contains filtered or unexported fields } func (*Lock) Run ¶ func (l *Lock) Run(key string, timeout time.Duration, handler func() error) type Locker ¶ type Locker interface { Run(key string, timeout time.Duration, handler func() error) } func New ¶ func New(opts ...Option) Locker type Option ¶ type Option func(*Options) func Logger ¶ func Logger(l logger.Logger) Option func Redis ¶ func Redis(r *redis.Client) Option type Options ¶ type Options struct { Redis *redis.Client Logger logger.Logger } Source Files ¶ View all Source files locker.gooptions.go Click to show internal directories. Click to hide internal directories.