View Source Electric.ShapeCache.ShapeStatusBehaviour behaviour (electric v0.7.3)

Behaviour defining the ShapeStatus functions to be used in mocks

Summary

Types

Callbacks

@callback add_shape(Electric.ShapeCache.ShapeStatus.t(), Electric.Shapes.Shape.t()) ::
  {:ok, shape_id()} | {:error, term()}
Link to this callback

get_existing_shape(t, arg2)

View Source
@callback initialise(Electric.ShapeCache.ShapeStatus.options()) ::
  {:ok, Electric.ShapeCache.ShapeStatus.t()} | {:error, term()}
Link to this callback

initialise_shape(t, shape_id, xmin, t)

View Source
@callback initialise_shape(
  Electric.ShapeCache.ShapeStatus.t(),
  shape_id(),
  xmin(),
  Electric.Replication.LogOffset.t()
) :: :ok
@callback list_shapes(Electric.ShapeCache.ShapeStatus.t()) :: [
  {shape_id(), Electric.Shapes.Shape.t()}
]
Link to this callback

mark_snapshot_started(t, shape_id)

View Source
@callback mark_snapshot_started(Electric.ShapeCache.ShapeStatus.t(), shape_id()) :: :ok
Link to this callback

remove_shape(t, shape_id)

View Source
@callback remove_shape(Electric.ShapeCache.ShapeStatus.t(), shape_id()) ::
  {:ok, Electric.Shapes.Shape.t()} | {:error, term()}
Link to this callback

set_latest_offset(t, shape_id, t)

View Source
@callback set_latest_offset(
  Electric.ShapeCache.ShapeStatus.t(),
  shape_id(),
  Electric.Replication.LogOffset.t()
) :: :ok
Link to this callback

set_snapshot_xmin(t, shape_id, xmin)

View Source
@callback set_snapshot_xmin(Electric.ShapeCache.ShapeStatus.t(), shape_id(), xmin()) ::
  :ok
Link to this callback

snapshot_started?(t, shape_id)

View Source
@callback snapshot_started?(Electric.ShapeCache.ShapeStatus.t(), shape_id()) :: boolean()