Documentation
¶
Index ¶
Constants ¶
View Source
const Type primitive.Type = "Lock"
Type is the lock type
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // GetLock gets the Lock instance of the given name GetLock(ctx context.Context, name string) (Lock, error) }
Client provides an API for creating Locks
type IfVersionOption ¶
type IfVersionOption struct {
// contains filtered or unexported fields
}
IfVersionOption is a lock option for checking the version
func IfVersion ¶
func IfVersion(version uint64) IfVersionOption
IfVersion sets the lock version to check
type IsLockedOption ¶
type IsLockedOption interface {
// contains filtered or unexported methods
}
IsLockedOption is an option for IsLocked calls
type Lock ¶
type Lock interface { primitive.Primitive // Lock acquires the lock Lock(ctx context.Context, opts ...LockOption) (uint64, error) // Unlock releases the lock Unlock(ctx context.Context, opts ...UnlockOption) (bool, error) // IsLocked returns a bool indicating whether the lock is held IsLocked(ctx context.Context, opts ...IsLockedOption) (bool, error) }
Lock provides distributed concurrency control
type LockOption ¶
type LockOption interface {
// contains filtered or unexported methods
}
LockOption is an option for Lock calls
func WithTimeout ¶
func WithTimeout(timeout time.Duration) LockOption
WithTimeout sets the lock timeout
type UnlockOption ¶
type UnlockOption interface {
// contains filtered or unexported methods
}
UnlockOption is an option for Unlock calls
Click to show internal directories.
Click to hide internal directories.