Documentation ¶
Overview ¶
Package lockutil contains a file based lock which can be used to lock file resources across different processes. The lock file is monitored by a Go routine. Invalidating the lock file (e.g. just writing a single character to it) causes the Go routine to exit. A client can check if the lockfile is still being monitored by calling WatcherRunning().
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LockFile ¶
type LockFile struct {
// contains filtered or unexported fields
}
LockFile data structure
func NewLockFile ¶
NewLockFile creates a new LockFile which and watch it in given intervals.
func (*LockFile) Finish ¶
Finish watching a lockfile and return once the watcher goroutine has finished.
func (*LockFile) SetWatcherRunning ¶
SetWatcherRunning sets if the watcher goroutine is running.
func (*LockFile) WatcherRunning ¶
WatcherRunning returns if the watcher goroutine is running.