View Source Electric.ShapeCacheBehaviour behaviour (electric v0.7.6)

Behaviour defining the ShapeCache functions to be used in mocks

Summary

Types

Callbacks

Link to this callback

await_snapshot_start(shape_id, opts)

View Source
@callback await_snapshot_start(shape_id(), opts :: keyword()) ::
  :started | {:error, term()}
@callback clean_all_shapes(GenServer.name()) :: :ok
Link to this callback

clean_shape(shape_id, keyword)

View Source
@callback clean_shape(
  shape_id(),
  keyword()
) :: :ok
Link to this callback

get_or_create_shape_id(shape_def, opts)

View Source
@callback get_or_create_shape_id(shape_def(), opts :: keyword()) ::
  {shape_id(), current_snapshot_offset :: Electric.Replication.LogOffset.t()}
Link to this callback

get_shape(shape_def, opts)

View Source
@callback get_shape(shape_def(), opts :: keyword()) ::
  {shape_id(), current_snapshot_offset :: Electric.Replication.LogOffset.t()}
Link to this callback

handle_truncate(shape_id, keyword)

View Source
@callback handle_truncate(
  shape_id(),
  keyword()
) :: :ok
Link to this callback

has_shape?(shape_id, keyword)

View Source
@callback has_shape?(
  shape_id(),
  keyword()
) :: boolean()
@callback list_shapes(Electric.ShapeCache.ShapeStatus.t()) :: [
  {shape_id(), Electric.Shapes.Shape.t()}
]
Link to this callback

update_shape_latest_offset(shape_id, t, keyword)

View Source
@callback update_shape_latest_offset(
  shape_id(),
  Electric.Replication.LogOffset.t(),
  keyword()
) :: :ok

Update a shape's status with a new log offset