The files Juggernaut keeps under _build/juggernaut/ (design notes §7).
This is the API the views read from:
Juggernaut.Store.Layout- the directory, its layout version and its paths;Juggernaut.Store.Runs-write/2,load/2andlist/1of whole runs;Juggernaut.Store.History- the append-onlyhistory/runs.ndjson;Juggernaut.Store.Lock- the checkout lock.
Every JSON file carries "format". Whole-file writes go through write_atomic/2
(a temporary file in the same directory, then a rename).
Summary
Functions
Reads and decodes a JSON file (string keys).
The store root of the project at project_root.
Writes contents to path atomically: a temporary file in the same directory, then
File.rename/2. Parent directories are created.
Functions
Reads and decodes a JSON file (string keys).
The store root of the project at project_root.
@spec write_atomic(Path.t(), iodata(), keyword()) :: :ok | {:error, File.posix()}
Writes contents to path atomically: a temporary file in the same directory, then
File.rename/2. Parent directories are created.
With mode: mode the temporary file is created empty and given mode before
contents are written to it, so the contents are never readable with wider
permissions, at the temporary path or the final one (for secrets such as the server's
token).