flock

package
v0.0.0-...-5b8b77a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2021 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLocked error = acquireFailedError("already locked")

ErrLocked indicates TryLock failed because the lock was already locked.

View Source
var ErrTimeout error = acquireTimeoutError("acquire timeout exceeded")

ErrTimeout indicates that the lock attempt timed out.

Functions

This section is empty.

Types

type Lock

type Lock interface {
	Acquire() error
	AcquireWithTimeout(time.Duration) error
	TryAcquire() error
	Release() error
}

Lock implements flock syscall based cross-process locking.

func New

func New(filename string) Lock

New returns a new lock around the given file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL