Documentation ¶
Overview ¶
Package lockfile defines a flock(2)-based implementation of the file lock.
Index ¶
Constants ¶
View Source
const ( FileOpenFlags = os.O_RDONLY FileCreateFlags = os.O_CREATE | os.O_EXCL | FileOpenFlags )
File* constants family defines flags which are used to open lock files.
View Source
const FileMode = os.FileMode(0666)
FileMode defines default permission for file lock open.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
Lock file is a thin wrapper around os.File to give user a possibility to use file as a lock (using flock(2))
func NewLock ¶
NewLock returns new lock instance. Argument is a path to the lock file. Please remember that file would be truncated so it should be file path for absent file or something which has insensitive content.
Click to show internal directories.
Click to hide internal directories.