sec

package sec

Members list

Concise view

Type members

Classlikes

sealed abstract case class CacheControl(value: FiniteDuration)

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.

Attributes

Companion:
object
Source:
metadata.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Companion:
class
Source:
metadata.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait ContentType

Content type for EventData. There are two variants:

Content type for EventData. There are two variants:

Attributes

Companion:
object
Source:
event.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Binary.type
object Json.type

Attributes

Companion:
trait
Source:
event.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait Event[P <: PositionInfo]

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.

Attributes

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
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class EventRecord[P]
class ResolvedEvent[P]
object Event

Attributes

Companion:
trait
Source:
event.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Event.type
final case class EventData(eventType: EventType, eventId: UUID, data: ByteVector, metadata: ByteVector, contentType: ContentType)

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.

Attributes

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
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object EventData

Attributes

Companion:
class
Source:
event.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class EventRecord[P <: PositionInfo](streamId: StreamId, position: P, eventData: EventData, created: ZonedDateTime) extends Event[P]

An event persisted in an event stream.

An event persisted in an event stream.

Attributes

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
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Event[P]
class Object
trait Matchable
class Any

Attributes

Companion:
class
Source:
event.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait EventType

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

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

Attributes

See also:

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

Companion:
object
Source:
event.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Normal
class System
object EventType

Attributes

Companion:
trait
Source:
event.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
final case class InvalidInput(msg: String) extends ValidationError

Attributes

Source:
error.scala
Graph
Supertypes
trait Product
trait Equals
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
sealed trait LogPosition

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

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

Attributes

Companion:
object
Source:
position.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object End.type
class Exact

Attributes

Companion:
trait
Source:
position.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
sealed abstract case class MaxAge(value: FiniteDuration)

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.

Attributes

Companion:
object
Source:
metadata.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object MaxAge

Attributes

Companion:
class
Source:
metadata.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
MaxAge.type
sealed abstract case class MaxCount(value: Int)

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.

Attributes

Companion:
object
Source:
metadata.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object MaxCount

Attributes

Companion:
class
Source:
metadata.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait PositionInfo

Attributes

Companion:
object
Source:
position.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Global
class Exact

Attributes

Companion:
trait
Source:
position.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class ResolvedEvent[P <: PositionInfo](event: EventRecord[P], link: EventRecord[P]) extends Event[P]

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

Attributes

event

the original and linked to event record.

link

the link event to the resolved event.

Companion:
object
Source:
event.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Event[P]
class Object
trait Matchable
class Any

Attributes

Companion:
class
Source:
event.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class StreamAcl(readRoles: Set[String], writeRoles: Set[String], deleteRoles: Set[String], metaReadRoles: Set[String], metaWriteRoles: Set[String])

Access Control List for a stream.

Access Control List for a stream.

Attributes

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
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object StreamAcl

Attributes

Companion:
class
Source:
metadata.scala
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait StreamId

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

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

Attributes

Companion:
object
Source:
id.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Id
class Normal
class System
class MetaId
object StreamId

Attributes

Companion:
trait
Source:
id.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait StreamPosition

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

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

Attributes

Companion:
object
Source:
position.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object End.type
class Exact

Attributes

Companion:
trait
Source:
position.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait StreamState

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:

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

Attributes

Companion:
object
Source:
position.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Exact
object Any.type
object NoStream.type
object StreamExists.type

Attributes

Companion:
trait
Source:
position.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed abstract class ValidationError(msg: String) extends RuntimeException with NoStackTrace

Attributes

Source:
error.scala
Graph
Supertypes
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Known subtypes

Types

Attributes

Source:
package.scala

Attributes

Source:
package.scala
type ULong = ULong

Attributes

Source:
package.scala

Value members

Concrete fields

val ULong: ULong.type

Attributes

Source:
package.scala