lock

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 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 Lock

type Lock interface {
	Acquire() error
	Expiry() time.Duration
	ExtendLease() (bool, error)
	Release() (bool, error)
}

type RedisLock

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

func NewRedisLock

func NewRedisLock(redisCli *redis.Client, name string, expiry time.Duration) *RedisLock

func (*RedisLock) Acquire

func (l *RedisLock) Acquire() error

func (*RedisLock) Expiry

func (l *RedisLock) Expiry() time.Duration

func (*RedisLock) ExtendLease

func (l *RedisLock) ExtendLease() (bool, error)

func (*RedisLock) Release

func (l *RedisLock) Release() (bool, error)

Jump to

Keyboard shortcuts

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