lockhelper

package
v0.0.0-...-b952f1b Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisLock

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

func NewRedisLock

func NewRedisLock(db *dbs.RedisDb) *RedisLock

func (*RedisLock) Lock

func (r *RedisLock) Lock(ctx context.Context, key string, value interface{}, expiration time.Duration) bool

func (*RedisLock) UnLock

func (r *RedisLock) UnLock(ctx context.Context, key string, value interface{}) (bool, error)

type TimeoutLock

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

func NewTimeoutLock

func NewTimeoutLock() *TimeoutLock

func (*TimeoutLock) Lock

func (l *TimeoutLock) Lock(timeout time.Duration) bool

func (*TimeoutLock) UnLock

func (l *TimeoutLock) UnLock()

Jump to

Keyboard shortcuts

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