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
valueas a checked record ofversion: anEnvelopeline with the checksum of its JSON, written byappend_jsonl. - append_
jsonl - Appends
valueas 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
versioninpath. 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.