flock

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

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

Lock provides in-process (channel) + cross-process (flock) mutual exclusion.

func New

func New(path string) *Lock

func (*Lock) Lock

func (l *Lock) Lock(ctx context.Context) error

func (*Lock) TryLock

func (l *Lock) TryLock(_ context.Context) (bool, error)

TryLock returns (false, nil) if the lock is currently held by another caller.

func (*Lock) Unlock

func (l *Lock) Unlock(_ context.Context) error

Jump to

Keyboard shortcuts

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