hecate_om_service behaviour (hecate_om v0.4.0)
View SourceSummary
Callbacks
Capabilities this service exposes, to be advertised on the mesh. Other services find this one by these names.
OPTIONAL. The on-disk root for this service's reckon-db store. The store data lands at data_dir/store_id.
Snapshot of current health. Called every /health hit.
UCAN this service wants minted by hecate-realm at boot. Until UCAN-delegation lands in realm, this is informational only.
Static metadata about the service. Reported on /health.
Start the service's supervision tree. Called once on boot.
Stop the service. Called on shutdown.
OPTIONAL. The reckon-db store_id this service owns. When exported alongside data_dir/0, hecate_om:boot/1 auto-starts the store and the per-store evoq subscription before the service module's own start/1 fires.
OPTIONAL. The reckon-db secondary index declarations this service's store maintains, e.g. [tags, event_type, {payload, <<"plate">>}, {payload_hash, [<<"lot_id">>, <<"plate">>]}]. When exported alongside store_id/0 + data_dir/0, hecate_om:boot/1 installs these on the auto-started store so CCC payload indexes are declared. Omit for a store with no secondary indexes.
OPTIONAL. The reckon-db store mode: single' (default) orcluster'. `cluster' makes reckon-db discover peers and form a Ra cluster across every node that starts the same store_id (RF = number of such nodes). When exported alongside store_id/0 + data_dir/0, hecate_om:boot/1 auto-starts the store in this mode. Omit for a standalone single-node store.
Types
-type capability() :: #{name := binary(), version := pos_integer()}.
-type identity_spec() :: #{scope := binary(), actions := [binary()], resources := [binary()], ttl_days := pos_integer()}.
Callbacks
-callback capabilities() -> [capability()].
Capabilities this service exposes, to be advertised on the mesh. Other services find this one by these names.
-callback data_dir() -> string().
OPTIONAL. The on-disk root for this service's reckon-db store. The store data lands at data_dir/store_id.
-callback health() -> health().
Snapshot of current health. Called every /health hit.
-callback identity_spec() -> identity_spec().
UCAN this service wants minted by hecate-realm at boot. Until UCAN-delegation lands in realm, this is informational only.
-callback info() -> info().
Static metadata about the service. Reported on /health.
Start the service's supervision tree. Called once on boot.
-callback stop(term()) -> ok.
Stop the service. Called on shutdown.
-callback store_id() -> atom().
OPTIONAL. The reckon-db store_id this service owns. When exported alongside data_dir/0, hecate_om:boot/1 auto-starts the store and the per-store evoq subscription before the service module's own start/1 fires.
-callback store_indexes() -> [term()].
OPTIONAL. The reckon-db secondary index declarations this service's store maintains, e.g. [tags, event_type, {payload, <<"plate">>}, {payload_hash, [<<"lot_id">>, <<"plate">>]}]. When exported alongside store_id/0 + data_dir/0, hecate_om:boot/1 installs these on the auto-started store so CCC payload indexes are declared. Omit for a store with no secondary indexes.
-callback store_mode() -> single | cluster.
OPTIONAL. The reckon-db store mode: single' (default) orcluster'. `cluster' makes reckon-db discover peers and form a Ra cluster across every node that starts the same store_id (RF = number of such nodes). When exported alongside store_id/0 + data_dir/0, hecate_om:boot/1 auto-starts the store in this mode. Omit for a standalone single-node store.