flock

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 3 Imported by: 0

README

flock

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

func LockFile(f *os.File) error

func TryLock

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

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

func TryLockFile

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