golock

package
v4.25.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2015 License: MIT Imports: 7 Imported by: 0

README

golock

Cross-platform lockfile library for Go.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBusy = errors.New("Locked by other process")

ErrBusy means a different process has locked the file not used for LockWithTimeout

View Source
var ErrNotOwner = errors.New("Process does not own lockfile")

ErrNotOwner means there was an attempt to unlock a lockfile that was not owned by the current process

View Source
var ErrReadingLockfile = errors.New("Error reading lockfile")

ErrReadlingLockfile means it could not read the pid out of an existing lockfile

View Source
var ErrTimeout = errors.New("Timed out")

ErrTimeout means there was a timeout waiting for the lockfile to be available

Functions

func Lock

func Lock(path string) error

Lock will attempt to grab a lock file at path it will wait until it becomes available

func Unlock

func Unlock(path string) error

Unlock will release the lock on a file

Types

This section is empty.

Jump to

Keyboard shortcuts

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