lockfile

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lockfile

type Lockfile struct {
	// contains filtered or unexported fields
}

Lockfile represents an acquired lockfile.

func Acquire

func Acquire(path string) (*Lockfile, error)

Acquire creates the given file path if it doesn't exist and obtains an exclusive lock on it. An error is returned if the lock has been obtained by another process.

func CreateAndAcquire

func CreateAndAcquire(path string, newDirMode os.FileMode) (*Lockfile, error)

CreateAndAcquire creates any non-existing directories needed to create the lock file, then acquires a lock on it

func (Lockfile) Release

func (lf Lockfile) Release() error

Release releases the lock on the file and removes the file.

Jump to

Keyboard shortcuts

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