evoq_snapshot_store (evoq v1.14.1)
View SourceWrapper for snapshot operations via adapter.
Provides a consistent interface for snapshot operations, delegating to a configured adapter.
Configuration (Required)
You must configure an adapter in your application config:
{evoq, [
{snapshot_store_adapter, evoq_esdb_gater_adapter}
]}
Summary
Functions
Delete all snapshots for a stream.
Delete a snapshot at a specific version.
Get the configured snapshot store adapter. Crashes if no adapter is configured.
Load the latest snapshot for a stream.
Load a snapshot at a specific version.
Save a snapshot.
Set the snapshot store adapter (primarily for testing).
Types
Functions
Delete all snapshots for a stream.
-spec delete(atom(), binary(), non_neg_integer()) -> ok | {error, term()}.
Delete a snapshot at a specific version.
-spec get_adapter() -> module().
Get the configured snapshot store adapter. Crashes if no adapter is configured.
Load the latest snapshot for a stream.
-spec load(atom(), binary(), non_neg_integer()) -> {ok, map()} | {error, not_found | term()}.
Load a snapshot at a specific version.
Save a snapshot.
-spec set_adapter(module()) -> ok.
Set the snapshot store adapter (primarily for testing).