Documentation
¶
Overview ¶
Package flock implements a cross-platform file lock.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flock ¶
type Flock struct {
// contains filtered or unexported fields
}
Flock is a cross-platform file lock. The zero value is not usable; use New to create a Flock.
func New ¶
New creates a new Flock for the given path. The lock file will be created if it does not exist.
func (*Flock) Lock ¶
Lock acquires an exclusive lock, blocking until available or context is cancelled. Uses exponential backoff starting at 50ms up to 200ms between retries.
func (*Flock) Locked ¶
Locked returns whether this Flock instance holds the lock. Note: by the time you use the returned value, the state may have changed.
Click to show internal directories.
Click to hide internal directories.