Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrInvalidHandle ¶
type ErrInvalidHandle struct {
// ID unique object identifier.
ID string
}
ErrInvalidHandle error type for invalid lock handle.
func (*ErrInvalidHandle) Error ¶
func (e *ErrInvalidHandle) Error() string
type ErrKeyLockNotFound ¶
type ErrKeyLockNotFound struct {
// ID unique object identifier.
ID string
}
ErrKeyLockNotFound error type for lock object not found
func (*ErrKeyLockNotFound) Error ¶
func (e *ErrKeyLockNotFound) Error() string
type KeyLock ¶
type KeyLock interface {
// Acquire a lock associated with the specified ID.
// Creates the lock if one doesn't already exist.
Acquire(id string) LockHandle
// Release the lock associated with the specified LockHandle
// Returns an error if it is an invalid LockHandle.
Release(h *LockHandle) error
// Dump all locks.
Dump() []string
}
KeyLock is a thread-safe interface for acquiring locks on arbitrary strings.
type LockHandle ¶
type LockHandle struct {
// contains filtered or unexported fields
}
LockHandle is an opaque handle to an aquired lock.
Click to show internal directories.
Click to hide internal directories.