View Source Statestores.Adapters.SnapshotBehaviour behaviour (spawn_statestores v2.0.0-RC11)

Defines the default behavior for each Statestore Provider.

Summary

Types

id()

@type id() :: String.t()

revision()

@type revision() :: integer()

snapshot()

@type snapshot() :: Statestores.Schemas.Snapshot.t()

snapshots()

@type snapshots() :: [Statestores.Schemas.Snapshot.t()]

time_end()

@type time_end() :: String.t()

time_start()

@type time_start() :: String.t()

Callbacks

default_port()

@callback default_port() :: <<_::32>>

get_all_snapshots_by_key(id)

@callback get_all_snapshots_by_key(id()) :: snapshots()

get_by_key(id)

@callback get_by_key(id()) :: snapshot()

get_by_key_and_revision(id, revision)

@callback get_by_key_and_revision(id(), revision()) :: snapshot()

get_snapshots_by_interval(id, time_start, time_end)

@callback get_snapshots_by_interval(id(), time_start(), time_end()) :: snapshots()

save(snapshot)

@callback save(snapshot()) :: {:error, any()} | {:ok, snapshot()}