Documentation
¶
Overview ¶
Package locking provides a file locking type that is robust to abrupt process termination.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
Locker provides file locking facilities.
func NewLocker ¶
NewLocker attempts to create a lock with the file at the specified path, creating the file if necessary. The lock is returned in an unlocked state.
func (*Locker) Close ¶
Close closes the file underlying the locker. This will release any lock held on the file and disable future locking. On POSIX platforms, this also releases other locks held on the same file.
func (*Locker) Read ¶
Read implements io.Reader.Read on the underlying file, but errors if the lock is not currently held.
Click to show internal directories.
Click to hide internal directories.