fcntllock

package module
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

type Lock struct {
	ReadWriteSeekCloser
	// contains filtered or unexported fields
}

Lock implement fcntl lock features

func (*Lock) LockContext

func (lck *Lock) LockContext(ctx context.Context, retryDelay time.Duration) error

LockContext repeat TryLock with retry delay until succeed or context Done

func (*Lock) TryLock

func (lck *Lock) TryLock() error

TryLock acquires an exclusive write file lock (non blocking)

func (Lock) UnLock

func (lck Lock) UnLock() (err error)

UnLock release lock

type Locker

type Locker = locker.Locker

func New

func New(path string) Locker

New create a new fcntl lock

type ReadWriteSeekCloser

type ReadWriteSeekCloser interface {
	io.ReadWriteSeeker
	io.Closer
}

Jump to

Keyboard shortcuts

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