Packages
commanded
0.17.1
1.4.10
1.4.9
1.4.8
1.4.7
1.4.6
1.4.3
1.4.2
1.4.1
1.4.0
1.4.0-rc.0
1.3.1
1.3.0
1.2.0
1.1.1
1.1.0
1.0.1
1.0.0
1.0.0-rc.1
1.0.0-rc.0
0.19.1
0.19.0
0.18.1
0.18.0
0.17.5
0.17.4
0.17.3
0.17.2
0.17.1
0.17.0
0.16.0
0.16.0-rc.1
0.16.0-rc.0
0.15.1
0.15.0
0.14.0
0.14.0-rc.0
0.13.0
0.12.0
0.11.0
0.10.0
0.9.0
0.8.5
0.8.4
0.8.3
0.8.1
0.8.0
0.7.1
0.6.2
0.6.1
0.6.0
0.4.0
0.3.1
0.3.0
0.2.1
0.2.0
0.1.0
Use Commanded to build your own Elixir applications following the CQRS/ES pattern.
Current section
Files
Jump to
Current section
Files
lib/commanded/event_store/recorded_event.ex
defmodule Commanded.EventStore.RecordedEvent do
@moduledoc """
Contains the persisted stream identity, type, data, and metadata for a single event.
Events are immutable once recorded.
## Recorded event fields
- `event_id` - a globally unique UUID to identify the event.
- `event_number` - a globally unique, monotonically incrementing and gapless
integer used to order the event amongst all events.
- `stream_id` - the stream identity for the event.
- `stream_version` - the version of the stream for the event.
- `causation_id` - an optional UUID identifier used to identify which
message you are responding to.
- `correlation_id` - an optional UUID identifier used to correlate related
messages.
- `data` - the serialized event as binary data.
- `metadata` - the serialized event metadata as binary data.
- `created_at` - the date/time, in UTC, indicating when the event was
created.
"""
@type uuid :: String.t
@type t :: %Commanded.EventStore.RecordedEvent{
event_id: uuid(),
event_number: non_neg_integer(),
stream_id: String.t,
stream_version: non_neg_integer(),
causation_id: uuid(),
correlation_id: uuid(),
event_type: String.t,
data: binary(),
metadata: binary(),
created_at: NaiveDateTime.t,
}
defstruct [
:event_id,
:event_number,
:stream_id,
:stream_version,
:causation_id,
:correlation_id,
:event_type,
:data,
:metadata,
:created_at,
]
end