fsx

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendLineLocked

func AppendLineLocked(path string, line []byte, mode os.FileMode) error

AppendLineLocked appends exactly one line to a file with a cross-process lock. The caller provides raw bytes for one record; this function appends a trailing newline and fsyncs the file before returning.

func WithFileLock added in v1.7.0

func WithFileLock(path string, fn func() error) error

WithFileLock serializes a read/validate/write critical section across processes using the same lock-file protocol as AppendLineLocked.

func WriteFileAtomic

func WriteFileAtomic(path string, content []byte, mode os.FileMode) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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