sec
Type members
Classlikes
Used for the ATOM API of EventStoreDB. The head of a feed in the ATOM API is not cacheable. This value allows you to specify a period of time you want it to be cacheable. Low numbers are best here, e.g. 30-60 seconds, and introducing values here will introduce latency over the ATOM protocol if caching is occuring.
Used for the ATOM API of EventStoreDB. The head of a feed in the ATOM API is not cacheable. This value allows you to specify a period of time you want it to be cacheable. Low numbers are best here, e.g. 30-60 seconds, and introducing values here will introduce latency over the ATOM protocol if caching is occuring.
- Companion:
- object
- Source:
- metadata.scala
Content type for EventData. There are two variants:
Content type for EventData. There are two variants:
- ContentType.Json used when event data and metadata are encoded as JSON.
- ContentType.Binary used when event data and metadata are encoded as binary. This can for instance be https://developers.google.com/protocol-buffers or utf8 encoded data like EventType.LinkTo events.
- Companion:
- object
- Source:
- event.scala
A persisted event in EventStoreDB. There are two variants:
A persisted event in EventStoreDB. There are two variants:
- EventRecord An event in an event stream.
- ResolvedEvent A special event that contains a link and a linked event record.
- Type parameters:
- P
Tells whether the event is retrieved from the global stream PositionInfo.Global or from an individual stream PositionInfo.Local.
- Companion:
- object
- Source:
- event.scala
Event payload for an event. This is the actual data that you persist in EventStoreDB.
Event payload for an event. This is the actual data that you persist in EventStoreDB.
- Value parameters:
- contentType
the ContentType of encoded data and metadata.
- data
a scodec.bits.ByteVector of encoded data.
- eventId
unique identifier for the event.
- eventType
the EventType for the event.
- metadata
a scodec.bits.ByteVector of encoded metadata.
- Companion:
- object
- Source:
- event.scala
An event persisted in an event stream.
An event persisted in an event stream.
- Value parameters:
- created
the creation date of the event in java.time.ZonedDateTime.
- eventData
the payload of the event.
- position
the position information about of the event.
- streamId
the stream identifier of the stream the event belongs to.
- Companion:
- object
- Source:
- event.scala
Event type for an Event. There are two event type variants:
Event type for an Event. There are two event type variants:
- EventType.System Type used for reserverd internal system events.
- EventType.Normal Type used by users.
- See also:
https://ahjohannessen.github.io/sec/docs/types#eventtype for more information about event type usage.
- Companion:
- object
- Source:
- event.scala
Log position for the global stream. There are two variants:
Log position for the global stream. There are two variants:
- LogPosition.Exact An exact position in the global stream.
- LogPosition.End Represents the end of the global stream.
- Companion:
- object
- Source:
- position.scala
The maximum age of events in the stream. Events older than this will be automatically removed.
The maximum age of events in the stream. Events older than this will be automatically removed.
- Companion:
- object
- Source:
- metadata.scala
The maximum count of events in the stream. When the stream has more than max count then the oldest will be removed.
The maximum count of events in the stream. When the stream has more than max count then the oldest will be removed.
- Companion:
- object
- Source:
- metadata.scala
Represents a EventType.LinkTo event that points to another event. Resolved events are common when reading or
subscribing to system prefixed streams, for instance category streams like $ce-
or $et-
.
Represents a EventType.LinkTo event that points to another event. Resolved events are common when reading or
subscribing to system prefixed streams, for instance category streams like $ce-
or $et-
.
- Value parameters:
- event
the original and linked to event record.
- link
the link event to the resolved event.
- Companion:
- object
- Source:
- event.scala
Access Control List for a stream.
Access Control List for a stream.
- Value parameters:
- deleteRoles
Roles and users permitted to delete the stream.
- metaReadRoles
Roles and users permitted to read stream metadata.
- metaWriteRoles
Roles and users permitted to write stream metadata.
- readRoles
Roles and users permitted to read the stream.
- writeRoles
Roles and users permitted to write to the stream.
- Companion:
- object
- Source:
- metadata.scala
Stream identifier for streams in EventStoreDB. There are three variants:
Stream identifier for streams in EventStoreDB. There are three variants:
- StreamId.System identifier used for reserverd internal system streams.
- StreamId.Normal identifier used by users.
- StreamId.MetaId identifier used for metadata streams of StreamId.System streams or StreamId.Normal streams.
Stream position in an individual stream. There are two variants:
Stream position in an individual stream. There are two variants:
- StreamPosition.Exact An exact position in a stream.
- StreamPosition.End Represents the end of a particular stream.
- Companion:
- object
- Source:
- position.scala
The expected state that a stream is currently in. There are four variants:
The expected state that a stream is currently in. There are four variants:
- StreamState.NoStream the stream does not exist yet.
- StreamState.Any No expectation of the current stream state.
- StreamState.StreamExists The stream, or its metadata stream, exists.
- StreamPosition.Exact The stream exists and its last written stream position is expected to be an exact value.
==Use Cases==
When you write to a stream for the first time you provide StreamState.NoStream. In order to decide if StreamState.NoStream is required you can try to read from the stream and if the read operation raises sec.api.exceptions.StreamNotFound you know that your expectation should be StreamState.NoStream.
When you do not have any expectation of the current state of a stream you should use StreamState.Any. This is, for instance, used when you just wish to append data to a stream regardless of other concurrent operations to the stream.
When you require that a stream, or its metadata stream, is present you should use StreamState.StreamExists.
When you need to implement optimistic concurrency you use StreamPosition.Exact and StreamState.NoStream as your exected stream state. You use StreamState.NoStream as expected stream state when you append to a stream for the first time, otherwise you use an StreamPosition.Exact value. A sec.api.exceptions.WrongExpectedState exception is rasised when the stream exists and has changed in the meantime.
- Companion:
- object
- Source:
- position.scala