locker

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

Redis locker

func NewRedis

func NewRedis(cli radix.Client, lockKey string, opts ...RedisOption) *Redis

NewRedis returns redis locker

func (*Redis) Lock

func (r *Redis) Lock() error

Lock acquires lock

func (*Redis) Unlock

func (r *Redis) Unlock()

Unlock release acquired lock

type RedisOption

type RedisOption func(*Redis)

RedisOption allows redefine default redis locker settings

func RedisLockTTL

func RedisLockTTL(ttl time.Duration) RedisOption

RedisLockTTL sets ttl for lock key

Jump to

Keyboard shortcuts

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