Versions in this module Expand all Collapse all v1 v1.4.15 Oct 19, 2026 v1.4.14 Oct 12, 2026 Changes in this version type Request + Quiet bool v1.4.13 Oct 11, 2026 Changes in this version + const EnvToken + var DefaultClock = RealClock() + var ErrHeld = errors.New("project operation lock is held") + var ErrUnsupported = errors.New("project operation lock is not supported on this platform") + var Stderr io.Writer = os.Stderr + func Guard(ctx context.Context, r Request) (context.Context, func(), error) + func LockPath(projectDir string) string + func Takes(sideEffect, output string) bool + func WithLock(ctx context.Context, l *Lock) context.Context + type Clock struct + Now func() time.Time + Sleep func(ctx context.Context, d time.Duration) error + func RealClock() Clock + type HeldError struct + Holder Holder + Known bool + Waited time.Duration + func (e *HeldError) Error() string + func (e *HeldError) Is(target error) bool + type Holder struct + Command string + Host string + PID int + StartedAt string + Token string + func ReadHolder(projectDir string) (Holder, error) + type Lock struct + func Acquire(ctx context.Context, projectDir string, opts Opts) (*Lock, error) + func FromContext(ctx context.Context) *Lock + func (l *Lock) Holder() Holder + func (l *Lock) Reentrant() bool + func (l *Lock) Release() + func (l *Lock) Token() string + type Opts struct + Clock Clock + Command string + Getenv func(string) string + OnWait func(h Holder, known bool) + Poll time.Duration + Wait time.Duration + type Request struct + Command string + Dir string + Output string + SideEffect string