Documentation
¶
Overview ¶
Package lock provides an advisory-locked file per environment so that two c2quay processes cannot deploy to the same environment simultaneously.
v0 uses flock(2) and is therefore local to the host. Distributed coordination (redis, consul) is a future extension.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAlreadyHeld = errors.New("lock is already held")
ErrAlreadyHeld is returned by Acquire when another process holds the lock.
Functions ¶
This section is empty.
Types ¶
type FileLock ¶
type FileLock struct {
// contains filtered or unexported fields
}
FileLock holds an exclusive flock(2) for its lifetime.
func Acquire ¶
Acquire takes an exclusive non-blocking flock on path. It returns ErrAlreadyHeld if another process currently holds the lock.
Click to show internal directories.
Click to hide internal directories.