View Source Electric.ShapeCacheBehaviour behaviour (electric v0.7.6)
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_id() :: String.t()
@type xmin() :: non_neg_integer()
Callbacks
@callback clean_all_shapes(GenServer.name()) :: :ok
@callback get_or_create_shape_id(shape_def(), opts :: keyword()) :: {shape_id(), current_snapshot_offset :: Electric.Replication.LogOffset.t()}
@callback get_shape(shape_def(), opts :: keyword()) :: {shape_id(), current_snapshot_offset :: Electric.Replication.LogOffset.t()}
@callback list_shapes(Electric.ShapeCache.ShapeStatus.t()) :: [ {shape_id(), Electric.Shapes.Shape.t()} ]
@callback update_shape_latest_offset( shape_id(), Electric.Replication.LogOffset.t(), keyword() ) :: :ok
Update a shape's status with a new log offset