lock

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 3 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 {
	Lock(key string, ttl time.Duration) (bool, error)
	//Check(key string) (bool, error)
	Unlock(key string) error
}

type Option

type Option func(*Options)

func WithLockTime

func WithLockTime(lockTime time.Duration) Option

type Options

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

type RedisLock

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

func (*RedisLock) Check

func (rl *RedisLock) Check(key string) (bool, error)

func (*RedisLock) Lock

func (rl *RedisLock) Lock(key string, ttl time.Duration) (bool, error)

func (*RedisLock) Provide

func (rl *RedisLock) Provide(context.Context) interface{}

func (*RedisLock) Unlock

func (rl *RedisLock) Unlock(key string) error

Jump to

Keyboard shortcuts

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