locker

package
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL