flock

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lock

func Lock(path string) (*os.File, error)

Lock gets an exclusive lock on the file at the given path. If the file doesn't exist, it's created.

func LockFile added in v1.3.3

func LockFile(f *os.File) error

func TryLock added in v1.3.2

func TryLock(path string) (*os.File, error)

TryLock will return a nil file if the file is already locked.

func TryLockFile added in v1.3.3

func TryLockFile(f *os.File) (bool, error)

Returns true if the lock was successfully acquired.

func Unlock

func Unlock(f *os.File) error

Unlock releases the lock acquired via the Lock function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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