persist

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDirectorySyncUnsupported = errors.New("directory sync unsupported")

Functions

func AtomicReplace

func AtomicReplace(path string, data []byte, hook Hook) error

AtomicReplace durably replaces path with data. The caller owns validation.

func SyncDir added in v0.2.0

func SyncDir(path string) error

SyncDir flushes a directory entry so a rename that has already returned survives a crash. It is the one owner of that call: a managed write is durable only when the entry naming its new bytes is on disk too.

Types

type Hook

type Hook func(step string) error

Hook is called at stable failure-injection points. It is nil in production.

Jump to

Keyboard shortcuts

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