Skip to main content

Module storage

Module storage 

Source
Expand description

Durable primitives extracted from route_search and route_archive (3ef2673).

Structs§

Envelope
Route archive v2 framing, kept byte compatible.

Functions§

append_checked
Appends value as a checked record of version: an Envelope line with the checksum of its JSON, written by append_jsonl.
append_jsonl
Appends value as one JSON line and syncs the file. A torn final line is ended first, so the new record never joins it.
digest
The lowercase hexadecimal SHA-256 of bytes.
lock
Stable inode lock. Never unlink it; atomic replacement is for data only.
lock_is_free
Liveness probe for a lock that a process holds for its whole lifetime.
read_checked
The checked records of version in path. An incomplete final line is ignored; a wrong version, a wrong checksum or earlier corruption is an error.
read_jsonl_resilient
Reads JSONL while ignoring only an incomplete final record.
repair_tail
Repair only after verified replay, under exclusive job ownership. A valid unterminated record is retained and receives its newline.
write_atomic_json
Writes a JSON snapshot to a sibling temporary file and atomically renames it over the target.