Documentation
¶
Overview ¶
Package wal is a durable, file-based write-ahead log of edit intents. Each Append fsyncs one JSON-encoded record (one line) to <dir>/wal.log; Replay reads every record back in order. There is no SQLite or external store: the log is a plain append-only file so a crash mid-edit can be reconciled on restart by replaying the recorded intents.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Intent ¶
type Intent struct {
// ID uniquely identifies this intent.
ID string `json:"id"`
// Edits are the byte-range replacements this intent will apply.
Edits []locator.FileEdit `json:"edits"`
// Originals maps each affected file path to its pre-edit raw bytes.
Originals map[string][]byte `json:"originals"`
// ExpectedRawHash maps each file path to its expected raw content hash.
ExpectedRawHash map[string]string `json:"expected_raw_hash"`
// ExpectedNormHash maps each file path to its expected normalized hash.
ExpectedNormHash map[string]string `json:"expected_norm_hash"`
}
Intent is one durably-recorded edit intent. It captures the edits to apply, the original bytes of each affected file (for restore-on-failure), and the expected raw and normalized content hashes per file (for drift detection) so a recovering process has everything needed to reapply or roll back.
Click to show internal directories.
Click to hide internal directories.