View Source Electric.ShapeCache.ShapeStatusBehaviour behaviour (electric v0.9.5)
Behaviour defining the ShapeStatus functions to be used in mocks
Summary
Types
@type shape_handle() :: Electric.ShapeCacheBehaviour.shape_handle()
@type xmin() :: Electric.ShapeCacheBehaviour.xmin()
Callbacks
@callback add_shape(Electric.ShapeCache.ShapeStatus.t(), Electric.Shapes.Shape.t()) :: {:ok, shape_handle()} | {:error, term()}
@callback get_existing_shape( Electric.ShapeCache.ShapeStatus.t(), Electric.Shapes.Shape.t() | shape_handle() ) :: {shape_handle(), Electric.Replication.LogOffset.t()} | nil
@callback initialise(Electric.ShapeCache.ShapeStatus.options()) :: {:ok, Electric.ShapeCache.ShapeStatus.t()} | {:error, term()}
@callback initialise_shape( Electric.ShapeCache.ShapeStatus.t(), shape_handle(), xmin(), Electric.Replication.LogOffset.t() ) :: :ok
@callback list_shapes(Electric.ShapeCache.ShapeStatus.t()) :: [ {shape_handle(), Electric.Shapes.Shape.t()} ]
@callback mark_snapshot_started(Electric.ShapeCache.ShapeStatus.t(), shape_handle()) :: :ok
@callback remove_shape(Electric.ShapeCache.ShapeStatus.t(), shape_handle()) :: {:ok, Electric.Shapes.Shape.t()} | {:error, term()}
@callback set_latest_offset( Electric.ShapeCache.ShapeStatus.t(), shape_handle(), Electric.Replication.LogOffset.t() ) :: :ok
@callback set_snapshot_xmin(Electric.ShapeCache.ShapeStatus.t(), shape_handle(), xmin()) :: :ok
@callback snapshot_started?(Electric.ShapeCache.ShapeStatus.t(), shape_handle()) :: boolean()