hecate_plugin_paths (hecate_sdk v0.6.2)

View Source

Standard directory layout for plugin data.

Replaces per-plugin path modules (e.g., app_scribed_paths.erl). All plugins get the same layout under their data directory:

~/.hecate/plugins/{plugin_name}/ ├── sqlite/ — SQLite read model databases ├── reckon-db/ — ReckonDB event store └── run/ — Runtime files (PID, etc.)

Resolution order for the base directory: 1. application:get_env(hecate, data_dir) — set when running inside hecate-daemon 2. HECATE_HOME env var — set when running as a standalone plugin 3. ~/.hecate — default fallback

Summary

Functions

Root data directory for a plugin.

Create all standard directories for a plugin.

ReckonDB directory for a plugin's event store.

Full path to a named ReckonDB store directory.

Runtime directory for PID files, temp data.

Full path to a named runtime file.

SQLite directory for a plugin's read models.

Full path to a named SQLite database file.

Functions

base_dir(PluginName)

-spec base_dir(PluginName :: string() | binary()) -> file:filename().

Root data directory for a plugin.

ensure_layout(PluginName)

-spec ensure_layout(string() | binary()) -> ok.

Create all standard directories for a plugin.

reckon_dir(PluginName)

-spec reckon_dir(string() | binary()) -> file:filename().

ReckonDB directory for a plugin's event store.

reckon_path(PluginName, StoreName)

-spec reckon_path(string() | binary(), string()) -> file:filename().

Full path to a named ReckonDB store directory.

run_dir(PluginName)

-spec run_dir(string() | binary()) -> file:filename().

Runtime directory for PID files, temp data.

run_path(PluginName, FileName)

-spec run_path(string() | binary(), string()) -> file:filename().

Full path to a named runtime file.

sqlite_dir(PluginName)

-spec sqlite_dir(string() | binary()) -> file:filename().

SQLite directory for a plugin's read models.

sqlite_path(PluginName, DbName)

-spec sqlite_path(string() | binary(), string()) -> file:filename().

Full path to a named SQLite database file.