WardrikDaemon.Dirs (wardrik_daemon v0.1.0-rc.1)

Copy Markdown

The directories the daemon keeps things in.

They follow the XDG base directories, so what you write stays apart from what the daemon writes. Each one's environment variable moves it.

VariableDefaultHolds
WARDRIK_CONFIG_DIR~/.config/wardrikconfig.yaml, agents/ and policies/
WARDRIK_DATA_DIR~/.local/share/wardrik/storethe store
WARDRIK_DATA_HOME~/.local/share/wardrikvault_key and cli_token
WARDRIK_STATE_DIR~/.local/state/wardriklogs
WARDRIK_ENV_FILEenv in the config directoryvariables the daemon sets where its environment doesn't

The defaults follow XDG_CONFIG_HOME, XDG_DATA_HOME and XDG_STATE_HOME where they're set.

Summary

Functions

Returns the path of name in the config directory, as agents or config.yaml.

Returns the path of name in the data home, as cli_token.

Returns the directories env, a map of environment variables, names.

Types

t()

@type t() :: %WardrikDaemon.Dirs{
  config: Path.t(),
  data: Path.t(),
  data_home: Path.t(),
  env_file: Path.t(),
  state: Path.t()
}

Functions

config(dirs, name)

@spec config(t(), String.t()) :: Path.t()

Returns the path of name in the config directory, as agents or config.yaml.

data_home(dirs, name)

@spec data_home(t(), String.t()) :: Path.t()

Returns the path of name in the data home, as cli_token.

new(env)

@spec new(%{required(String.t()) => String.t()}) :: t()

Returns the directories env, a map of environment variables, names.