Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LocksDir string Locks map[string]LockObject DefaultTimeout = 24 * time.Hour )
Functions ¶
func Lock ¶
func Lock(name string, opts LockOptions) error
Types ¶
type LockObject ¶
type LockObject interface {
GetName() string
Lock(timeout time.Duration, readOnly bool, onWait func(doWait func() error) error) error
Unlock() error
WithLock(timeout time.Duration, readOnly bool, onWait func(doWait func() error) error, f func() error) error
}
func NewFileLock ¶
func NewFileLock(name string, locksDir string) LockObject
type LockOptions ¶
Click to show internal directories.
Click to hide internal directories.