Skip to main content

Module paths

Module paths 

Source
Expand description

Where grabcli keeps its files, and private/atomic file writes.

  • config dir: $GRABCLI_CONFIG_DIR, else $XDG_CONFIG_HOME/grabcli, else ~/.config/grabcli. Holds config.toml, session.json (0600) and the optional hydra-key.pem (0600).
  • state dir: $GRABCLI_STATE_DIR, else $XDG_STATE_HOME/grabcli, else ~/.local/state/grabcli. Each service gets a subdirectory (food/).
  • cache dir: $GRABCLI_CACHE_DIR, else $XDG_CACHE_HOME/grabcli, else ~/.cache/grabcli. Disposable response cache (see crate::cache).

Functionsยง

cache_dir
config_dir
config_path
$GRABCLI_CONFIG or <config dir>/config.toml.
ensure_private_dir
Create dir (and parents) with mode 0700 on the leaf.
session_path
$GRABCLI_SESSION or <config dir>/session.json.
state_dir
write_atomic
Atomically write a non-secret file (tmp + rename, default permissions).
write_private
Atomically write a secret file: parent dir 0700, file 0600 from the moment it is created, then renamed over path.