flock

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: MIT Imports: 7 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

type T struct {
	locker.Locker
	Path string
	// contains filtered or unexported fields
}

T wraps flock and dumps a json data in the lock file hinting about what holds the lock.

func New

func New(p string, sessionId string, lockP func(string) locker.Locker) *T

New allocate a file lock struct from Locker provider.

func (*T) Lock

func (t *T) Lock(timeout time.Duration, intent string) (err error)

Lock acquires an exclusive file lock on the file and write a json formatted structure hinting who holds the lock and with what intention.

func (*T) UnLock

func (t *T) UnLock() error

UnLock releases the file lock acquired by Lock.

Jump to

Keyboard shortcuts

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