incident v0.3.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 Source
persisted_event()
View Source
persisted_event() ::
Incident.EventStore.InMemoryEvent.t() | Incident.EventStore.PostgresEvent.t()
persisted_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 Source
append(map)
View Source
append(map()) :: {:ok, persisted_event()} | {:error, String.t() | struct()}
append(map()) :: {:ok, persisted_event()} | {:error, String.t() | struct()}
Appends an event to the Event Store.
Link to this callback
get(arg1)
View Source
get(arg1)
View Source
get(String.t()) :: [persisted_event()]
get(String.t()) :: [persisted_event()]
Receives an aggregate id and returns a list containing all persisted events from the Event Store.