filelocker

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimeout = errors.New("timeout")
)

Functions

func LockFile

func LockFile(locker *FileLocker, mode os.FileMode, exclusive bool, timeout time.Duration) error

LockFile acquires an advisory lock on a file descriptor.

func UnlockFile

func UnlockFile(locker *FileLocker) error

UnlockFile releases an advisory lock on a file descriptor.

Types

type FileLocker

type FileLocker struct {
	FilePath     string
	LockFilePath string
	// contains filtered or unexported fields
}

func NewFileLocker

func NewFileLocker(path string) *FileLocker

Jump to

Keyboard shortcuts

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