lockfile

package
v0.0.0-...-9649366 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

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