locker

package
v0.0.0-...-41aba7b Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotHeld = errors.NewStackError("redis-lock: not held anymore")

Functions

func Lock

func Lock(client *redis.Client, key string, value interface{}, timeout time.Duration) (ok bool, err error)

1: lock success if ok is true and err is nil 2: lock failed if ok is false or err is nil

func Unlock

func Unlock(client *redis.Client, key string, value interface{}) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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