gttllock

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLock

func IsLock(key string) bool

IsLock 加锁,时间为毫秒

func Lock

func Lock(key string, ttl int64)

Lock 加锁,时间为毫秒

func TryLock

func TryLock(key string, ttl int64) bool

TryLock 尝试加锁,时间为毫秒

func Unlock

func Unlock(key string)

Types

type Locker

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

func (*Locker) IsLock

func (l *Locker) IsLock(key string) bool

IsLock 是否已锁定

func (*Locker) Lock

func (l *Locker) Lock(key string, ttl int64)

Lock 加锁

func (*Locker) TryLock

func (l *Locker) TryLock(key string, ttl int64) bool

TryLock 尝试加锁

func (*Locker) Unlock

func (l *Locker) Unlock(key string)

Unlock 解锁

Jump to

Keyboard shortcuts

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