View Source Electric.ShapeCache.ShapeStatusBehaviour behaviour (electric v0.6.3)
Behaviour defining the ShapeStatus functions to be used in mocks
Summary
Types
@type shape_id() :: Electric.ShapeCacheBehaviour.shape_id()
@type xmin() :: Electric.ShapeCacheBehaviour.xmin()
Callbacks
@callback add_shape(Electric.ShapeCache.ShapeStatus.t(), Electric.Shapes.Shape.t()) :: {:ok, shape_id()} | {:error, term()}
@callback get_existing_shape( Electric.ShapeCache.ShapeStatus.t(), Electric.Shapes.Shape.t() | shape_id() ) :: {shape_id(), Electric.Replication.LogOffset.t()} | nil
@callback get_relation( Electric.ShapeCache.ShapeStatus.t(), Electric.Postgres.LogicalReplication.Messages.relation_id() ) :: Electric.Replication.Changes.Relation.t() | nil
@callback initialise(Electric.ShapeCache.ShapeStatus.options()) :: {:ok, Electric.ShapeCache.ShapeStatus.t()} | {:error, term()}
@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()} ]
@callback remove_shape(Electric.ShapeCache.ShapeStatus.t(), shape_id()) :: {:ok, Electric.Shapes.Shape.t()} | {:error, term()}
@callback snapshot_started?(Electric.ShapeCache.ShapeStatus.t(), shape_id()) :: boolean()
@callback store_relation( Electric.ShapeCache.ShapeStatus.t(), Electric.Replication.Changes.Relation.t() ) :: :ok