p

sec

package sec

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. sec
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package api

Type Members

  1. type AllEvent = Event[Global]
  2. sealed abstract case class CacheControl extends Product with Serializable

    Used for the ATOM API of EventStoreDB.

    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.

  3. sealed trait ContentType extends AnyRef

    Content type for EventData.

    Content type for EventData. There are two variants:

  4. sealed trait Event[P <: PositionInfo] extends AnyRef

    A persisted event in EventStoreDB.

    A persisted event in EventStoreDB. There are two variants:

    P

    Tells whether the event is retrieved from the global stream PositionInfo.Global or from an individual stream PositionInfo.Local.

  5. final case class EventData(eventType: EventType, eventId: UUID, data: ByteVector, metadata: ByteVector, contentType: ContentType) extends Product with Serializable

    Event payload for an event.

    Event payload for an event. This is the actual data that you persist in EventStoreDB.

    eventType

    the EventType for the event.

    eventId

    unique identifier for the event.

    data

    a scodec.bits.ByteVector of encoded data.

    metadata

    a scodec.bits.ByteVector of encoded metadata.

    contentType

    the ContentType of encoded data and metadata.

  6. final case class EventRecord[P <: PositionInfo](streamId: StreamId, position: P, eventData: EventData, created: ZonedDateTime) extends Event[P] with Product with Serializable

    An event persisted in an event stream.

    An event persisted in an event stream.

    streamId

    the stream identifier of the stream the event belongs to.

    position

    the position information about of the event.

    eventData

    the payload of the event.

    created

    the creation date of the event in java.time.ZonedDateTime.

  7. sealed trait EventType extends AnyRef

    Event type for an Event.

    Event type for an Event. There are two event type variants:

    See also

    https://ahjohannessen.github.io/sec/docs/types#eventtype for more information about event type usage.

  8. final case class InvalidInput(msg: String) extends ValidationError with Product with Serializable
  9. sealed trait LogPosition extends AnyRef

    Log position for the global stream.

    Log position for the global stream. There are two variants:

  10. sealed abstract case class MaxAge extends Product with Serializable

    The maximum age of events in the stream.

    The maximum age of events in the stream. Events older than this will be automatically removed.

  11. sealed abstract case class MaxCount extends Product with Serializable

    The maximum count of events in the stream.

    The maximum count of events in the stream. When the stream has more than max count then the oldest will be removed.

  12. sealed trait PositionInfo extends AnyRef
  13. final case class ResolvedEvent[P <: PositionInfo](event: EventRecord[P], link: EventRecord[P]) extends Event[P] with Product with Serializable

    Represents a EventType.LinkTo event that points to another event.

    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-.

    event

    the original and linked to event record.

    link

    the link event to the resolved event.

  14. final case class StreamAcl(readRoles: Set[String], writeRoles: Set[String], deleteRoles: Set[String], metaReadRoles: Set[String], metaWriteRoles: Set[String]) extends Product with Serializable

    Access Control List for a stream.

    Access Control List for a stream.

    readRoles

    Roles and users permitted to read the stream.

    writeRoles

    Roles and users permitted to write to the stream.

    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.

  15. type StreamEvent = Event[Local]
  16. sealed trait StreamId extends AnyRef

    Stream identifier for streams in EventStoreDB.

    Stream identifier for streams in EventStoreDB. There are three variants:

  17. sealed trait StreamPosition extends AnyRef

    Stream position in an individual stream.

    Stream position in an individual stream. There are two variants:

  18. sealed trait StreamState extends AnyRef

    The expected state that a stream is currently in.

    The expected state that a stream is currently in. There are four variants:

    122Use Cases122

    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.

  19. sealed abstract class ValidationError extends RuntimeException with NoStackTrace

Value Members

  1. object CacheControl extends Serializable
  2. object ContentType
  3. object Event
  4. object EventData extends Serializable
  5. object EventRecord extends Serializable
  6. object EventType
  7. object LogPosition
  8. object MaxAge extends Serializable
  9. object MaxCount extends Serializable
  10. object PositionInfo
  11. object ResolvedEvent extends Serializable
  12. object StreamAcl extends Serializable
  13. object StreamId
  14. object StreamPosition
  15. object StreamState

Inherited from AnyRef

Inherited from Any

Ungrouped