Documentation
¶
Index ¶
- Constants
- Variables
- func MutexLock(lockID string, ttl int64, backend Backend) error
- func MutexTryLock(lockID string, ttl int64, deadline int64, backend Backend) bool
- func MutexUnlock(lockID string, backend Backend) error
- func MutexWithCustomID(id string) func(mutex *Mutex)
- func MutexWithTTL(deadline time.Duration) func(mutex *Mutex)
- type Backend
- type Mutex
- type MutexOption
Constants ¶
View Source
const ( Namespace string = "_Locker" TTL = time.Second * 30 )
Variables ¶
View Source
var (
ErrStatusBusy = errors.New("status busy")
)
Functions ¶
func MutexTryLock ¶
func MutexUnlock ¶
func MutexWithCustomID ¶
func MutexWithTTL ¶
Types ¶
type Mutex ¶
type MutexOption ¶
type MutexOption func(*Mutex)
Click to show internal directories.
Click to hide internal directories.