Expand description
Validated, atomic JSON persistence serialized by one application state.
Structsยง
- Storage
- Reads and writes
settings.json,accounts.json, andtheme.cssin the data folder.
Enumsยง
- Storage
Error - Why local data couldnโt be read or written.
Staticsยง
- TEMP_
SEQUENCE ๐ - Distinguishes temporary files written concurrently by this process.
Functionsยง
- read_
json ๐ - Parses a JSON file.
- replace_
file ๐ - Replaces
towithfromin one step, flushing the move to disk. - sync_
directory ๐ - Does nothing; this platform doesnโt need directory flushes.
- validate_
accounts ๐ - Validates each account and rejects duplicate IDs.
- write_
atomic ๐ - Writes to a temporary file, flushes it, and moves it over
path, so a crash leaves either the old or the new file. On Unix the file is readable only by its owner. - write_
json_ ๐atomic - Writes pretty-printed JSON with
write_atomic.