View Source Incident.EventStore.Adapter behaviour (incident v0.6.2)
Defines the API for an Event Store adapter.
Link to this section Summary
Types
Depending the adapter used to store the events, the persisted event will be defined by a different schema.
Callbacks
Appends an event to the Event Store.
Receives an aggregate id and returns a list containing all persisted events from the Event Store.
Link to this section Types
@type persisted_event() :: Incident.EventStore.InMemory.Event.t() | Incident.EventStore.Postgres.Event.t()
Depending the adapter used to store the events, the persisted event will be defined by a different schema.
Link to this section Callbacks
@callback append(map()) :: {:ok, persisted_event()} | {:error, String.t() | struct()}
Appends an event to the Event Store.
@callback get(String.t()) :: [persisted_event()]
Receives an aggregate id and returns a list containing all persisted events from the Event Store.