View Source Electric.ShapeCacheBehaviour behaviour (electric v0.9.5)
Behaviour defining the ShapeCache functions to be used in mocks
Summary
Callbacks
Update a shape's status with a new log offset
Types
@type shape_def() :: Electric.Shapes.Shape.t()
@type shape_handle() :: String.t()
@type xmin() :: non_neg_integer()
Callbacks
@callback await_snapshot_start(shape_handle(), opts :: keyword()) :: :started | {:error, term()}
@callback clean_all_shapes(keyword()) :: :ok
@callback clean_shape( shape_handle(), keyword() ) :: :ok
@callback get_or_create_shape_handle(shape_def(), opts :: keyword()) :: {shape_handle(), current_snapshot_offset :: Electric.Replication.LogOffset.t()}
@callback get_shape(shape_def(), opts :: keyword()) :: {shape_handle(), current_snapshot_offset :: Electric.Replication.LogOffset.t()} | nil
@callback handle_truncate( shape_handle(), keyword() ) :: :ok
@callback has_shape?( shape_handle(), keyword() ) :: boolean()
@callback list_shapes(keyword() | map()) :: [{shape_handle(), Electric.Shapes.Shape.t()}]
@callback update_shape_latest_offset( shape_handle(), Electric.Replication.LogOffset.t(), keyword() ) :: :ok
Update a shape's status with a new log offset