incident v0.4.0 Incident.EventStore.Adapter behaviour View Source
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
Link to this type
persisted_event()
View Sourcepersisted_event() :: Incident.EventStore.InMemoryEvent.t() | Incident.EventStore.PostgresEvent.t()
Depending the adapter used to store the events, the persisted event will be defined by a different schema.
Link to this section Callbacks
Link to this callback
append(map)
View Sourceappend(map()) :: {:ok, persisted_event()} | {:error, String.t() | struct()}
Appends an event to the Event Store.
Receives an aggregate id and returns a list containing all persisted events from the Event Store.