flock

package
v2.10.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: GPL-3.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Releaser

type Releaser interface {
	Release() error
}

Releaser provides the Release method to release chain file lock.

func New

func New(fileName string) (r Releaser, existed bool, err error)

New locks the file with the provided name. If the file does not exist, it is created. The returned Releaser is used to release the lock. existed is true if the file to lock already existed. A non-nil error is returned if the locking has failed. Neither this function nor the returned Releaser is goroutine-safe.

Jump to

Keyboard shortcuts

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