distributedlock

package
v1.0.1-0...-984eda3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var WithExpire = func(expire time.Duration) optionFunc {
	return func(locker Locker) {
		locker.setExpire(expire)
	}
}
View Source
var WithKeyPrefix = func(prefix string) optionFunc {
	return func(locker Locker) {
		locker.setKeyPrefix(prefix)
	}
}

Functions

This section is empty.

Types

type Locker

type Locker interface {
	Lock(ctx context.Context, key string, value string) (bool, error)
	Unlock(ctx context.Context, key string, value string) (success bool, err error)
	// contains filtered or unexported methods
}

func NewRedisLocker

func NewRedisLocker(client *redis.Client, optionFunc ...optionFunc) Locker

Jump to

Keyboard shortcuts

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