redislock

package
v0.0.0-...-183aa75 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotObtained is returned when a lock cannot be obtained.
	ErrNotObtained = redislock.ErrNotObtained

	// ErrLockNotHeld is returned when trying to release an inactive lock.
	ErrLockNotHeld = redislock.ErrLockNotHeld
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Obtain(key string, ttl time.Duration) (Locker, error)
}

func New

func New(addr, password string) Client

type Locker

type Locker interface {
	Key() string
	TTL() (time.Duration, error)
	Refresh(ttl time.Duration) error
	Release() error
}

Jump to

Keyboard shortcuts

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