Help us shape the future of Go! Take the 2026 Go Developer Survey

filelock

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package filelock serializes a read-modify-write of a small shared file (the trust store) across celeste processes with an advisory lock on a sidecar file.

Index

Constants

View Source
const Supported = true

Supported reports whether Lock excludes anything on this platform.

Variables

This section is empty.

Functions

func Lock

func Lock(path string, wait time.Duration) (unlock func(), err error)

Lock takes an exclusive lock on path (created 0600 if missing; it is never removed, as removing a lock file lets two holders lock different files), waiting at most wait for another holder to let go. The lock belongs to the open file, so two holders in one process exclude each other too. unlock releases it. Where the platform has no file lock (Supported is false) Lock excludes nothing and always succeeds.

Types

This section is empty.

Jump to

Keyboard shortcuts

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