View Source Incident.ProjectionStore.Adapter behaviour (incident v0.6.2)

Defines the API for a Projection Store adapter.

Link to this section Summary

Callbacks

Returns all projections from a specific projection type from the Projection Store.

Returns a projection record from a specific projection type from the Projection Store.

Insert or updates a projection in the Projection Store.

Link to this section Callbacks

@callback all(module()) :: list()

Returns all projections from a specific projection type from the Projection Store.

@callback get(module(), String.t()) :: struct() | nil

Returns a projection record from a specific projection type from the Projection Store.

@callback project(module(), map()) :: {:ok | :error, map()}

Insert or updates a projection in the Projection Store.

Receives the projection type and the data for the projection.