View Source Statestores.Adapters.SnapshotBehaviour behaviour (spawn_statestores v1.4.0)

Defines the default behavior for each Statestore Provider.

Summary

Types

@type id() :: String.t()
@type revision() :: integer()
@type snapshot() :: Statestores.Schemas.Snapshot.t()
@type snapshots() :: [Statestores.Schemas.Snapshot.t()]
@type time_end() :: String.t()
@type time_start() :: String.t()

Callbacks

@callback default_port() :: <<_::32>>
Link to this callback

get_all_snapshots_by_key(id)

View Source
@callback get_all_snapshots_by_key(id()) :: snapshots()
@callback get_by_key(id()) :: snapshot()
Link to this callback

get_by_key_and_revision(id, revision)

View Source
@callback get_by_key_and_revision(id(), revision()) :: snapshot()
Link to this callback

get_snapshots_by_interval(id, time_start, time_end)

View Source
@callback get_snapshots_by_interval(id(), time_start(), time_end()) :: snapshots()
@callback save(snapshot()) :: {:error, any()} | {:ok, snapshot()}