filelocks

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireReadLock

func AcquireReadLock(file string) (*flock.Flock, error)

AcquireReadLock tries to acquire a shared lock to read from the file and returns a lock object or an error accordingly.

func AcquireWriteLock

func AcquireWriteLock(file string) (*flock.Flock, error)

AcquireWriteLock tries to acquire a shared lock to write from the file and returns a lock object or an error accordingly.

func FlockFile

func FlockFile(file string) string

FlockFile returns the flock filename for a given file name it returns an empty string if the input is empty

func ReleaseLock

func ReleaseLock(lock *flock.Flock) error

ReleaseLock releases a lock from a file that was previously created by AcquireReadLock or AcquireWriteLock.

Types

This section is empty.

Jump to

Keyboard shortcuts

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