lockfile

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package lockfile provides owner-token based local file locking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(next Options)

Configure sets package-level defaults for locks created by New.

Types

type Lock

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

Lock provides owner-token based file locking.

func New

func New(path string) *Lock

New creates a Lock for the given base path.

func (*Lock) Acquire

func (l *Lock) Acquire() error

Acquire attempts to acquire the lock.

func (*Lock) Release

func (l *Lock) Release() error

Release removes the lock only if this process still owns it.

type Options

type Options struct {
	TimeoutEnvVar        string
	DetailedTimeoutError bool
	WarnBelowMinTimeout  bool
	Stderr               io.Writer
}

Options configures lock acquisition behavior.

Jump to

Keyboard shortcuts

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