Electric.ShapeCache.ShapeStatusBehaviour behaviour (electric v1.0.24)

View Source

Behaviour defining the ShapeStatus functions to be used in mocks

Summary

Types

shape_handle()

@type shape_handle() :: Electric.ShapeCacheBehaviour.shape_handle()

xmin()

@type xmin() :: Electric.ShapeCacheBehaviour.xmin()

Callbacks

add_shape(t, t)

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

get_existing_shape(t, arg2)

initialise(options)

@callback initialise(Electric.ShapeCache.ShapeStatus.options()) ::
  {:ok, Electric.ShapeCache.ShapeStatus.t()} | {:error, term()}

initialise_shape(t, shape_handle, xmin, t)

list_shapes(t)

mark_snapshot_started(t, shape_handle)

@callback mark_snapshot_started(Electric.ShapeCache.ShapeStatus.t(), shape_handle()) ::
  :ok

remove_shape(t, shape_handle)

@callback remove_shape(Electric.ShapeCache.ShapeStatus.t(), shape_handle()) ::
  {:ok, Electric.Shapes.Shape.t()} | {:error, term()}

set_latest_offset(t, shape_handle, t)

set_snapshot_xmin(t, shape_handle, xmin)

@callback set_snapshot_xmin(Electric.ShapeCache.ShapeStatus.t(), shape_handle(), xmin()) ::
  :ok

snapshot_started?(t, shape_handle)

@callback snapshot_started?(Electric.ShapeCache.ShapeStatus.t(), shape_handle()) ::
  boolean()