View Source Electric.ShapeCacheBehaviour behaviour (electric v1.0.1)
Behaviour defining the ShapeCache functions to be used in mocks
Summary
Types
@type shape_def() :: Electric.Shapes.Shape.t()
@type shape_handle() :: String.t()
Callbacks
@callback await_snapshot_start(shape_handle(), opts :: Access.t()) :: :started | {:error, term()}
@callback clean_all_shapes(Access.t()) :: :ok
@callback clean_shape(shape_handle(), Access.t()) :: :ok
@callback get_or_create_shape_handle(shape_def(), opts :: Access.t()) :: {shape_handle(), current_snapshot_offset :: Electric.Replication.LogOffset.t()}
@callback get_shape(shape_def(), opts :: Access.t()) :: {shape_handle(), current_snapshot_offset :: Electric.Replication.LogOffset.t()} | nil
@callback has_shape?(shape_handle(), Access.t()) :: boolean()
@callback list_shapes(keyword() | map()) :: [{shape_handle(), Electric.Shapes.Shape.t()}]