Documentation
¶
Overview ¶
lockfile - package that manages filesystem locks.
This package enables the caller to use filesystem locks. It uses the operating system file creation system call with the exclusive flag.
This package relies on callers to always check errors. Failure to do so may result in corruption.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTimeout = errors.New("timeout")
)
Functions ¶
This section is empty.
Types ¶
type LockFile ¶
type LockFile struct {
// contains filtered or unexported fields
}
LockFile opaque type that contains the lockfile context.
func (*LockFile) Lock ¶
Lock attempts to create a lock file within the given timeout. If the lock can not be obtained within the given timeout or due to a filesystem error it returns failure. The caller must check the error.
func (*LockFile) Resolution ¶
Resolution sets the retry resolution. The default retry resolution is 100ms.
Click to show internal directories.
Click to hide internal directories.