Documentation ¶
Overview ¶
Package filelock implements an exclusive filesystem lock which allows the caller to atomically update the file safely as well. It is built on top of the rkt `filelock` package. It is partially related to discussion in https://github.com/rkt/rkt/pull/3615
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AlreadyUnlockedErr = errors.New("lock is already unlocked")
Functions ¶
This section is empty.
Types ¶
type UpdateableFileLock ¶
type UpdateableFileLock struct {
// contains filtered or unexported fields
}
UpdateableFileLock is a filelock which can be updated atomically
func NewExclusiveLock ¶
func NewExclusiveLock(path string) (*UpdateableFileLock, error)
NewExclusiveLock creates a new exclusive filelock. The given filepath must exist.
func (*UpdateableFileLock) Unlock ¶
func (l *UpdateableFileLock) Unlock() error
Unlock unlocks the filelock
Click to show internal directories.
Click to hide internal directories.