fcntllock

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: GPL-2.0 Imports: 6 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(path string) locker.Locker

New create a new fcntl lock

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 ReadWriteSeekCloser

type ReadWriteSeekCloser interface {
	io.ReadWriteSeeker
	io.Closer
}

Directories

Path Synopsis
Package mock_fcntllock is a generated GoMock package.
Package mock_fcntllock is a generated GoMock package.

Jump to

Keyboard shortcuts

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