MetaStreams

trait MetaStreams[F[_]]

API for interacting with metadata streams in EventStoreDB.

Methods for getting, setting and unsetting metadata for streams.

Type Params
F

the effect type in which MetaStreams operates.

Companion
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def getAcl(id: Id): F[Option[ReadResult[StreamAcl]]]

Gets the access control list for a stream.

Gets the access control list for a stream.

Value Params
id

the id of the stream.

Returns

an optional result for the metadata stream containing current StreamPosition for the metadata stream and the StreamAcl value.

def getCacheControl(id: Id): F[Option[ReadResult[CacheControl]]]

Gets the cache control for a stream.

Gets the cache control for a stream.

Value Params
id

the id of the stream.

Returns

an optional result for the metadata stream containing current StreamPosition for the metadata stream and the CacheControl value.

def getCustom[T](id: Id)(implicit evidence$1: Decoder[T]): F[Option[ReadResult[T]]]

Gets a custom JSON encoded metadata value for a stream using a provided decoder.

Gets a custom JSON encoded metadata value for a stream using a provided decoder.

Value Params
id

the id of the stream.

Returns

an optional result for the metadata stream containing current StreamPosition for the metadata stream and a JSON value using the provided io.circe.Decoder decoder.

def getMaxAge(id: Id): F[Option[ReadResult[MaxAge]]]

Gets the max age for a stream.

Gets the max age for a stream.

Value Params
id

the id of the stream.

Returns

an optional result for the metadata stream containing current StreamPosition for the metadata stream and the MaxAge value.

def getMaxCount(id: Id): F[Option[ReadResult[MaxCount]]]

Gets the max count for a stream.

Gets the max count for a stream.

Value Params
id

the id of the stream.

Returns

an optional result for the metadata stream containing current StreamPosition for the metadata stream and the MaxCount value.

def getTruncateBefore(id: Id): F[Option[ReadResult[Exact]]]

Gets the StreamPosition value that a stream is truncated before.

Gets the StreamPosition value that a stream is truncated before.

Value Params
id

the id of the stream.

Returns

an optional result for the metadata stream containing current StreamPosition for the metadata stream and the StreamPosition truncate before value.

def setAcl(id: Id, expectedState: StreamState, acl: StreamAcl): F[WriteResult]

Sets StreamAcl for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Sets StreamAcl for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Value Params
acl

the access control list for the stream.

expectedState

the state that the stream is expected to in. See StreamState for details.

id

the id of the stream.

def setCacheControl(id: Id, expectedState: StreamState, cacheControl: CacheControl): F[WriteResult]

Sets CacheControl for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Sets CacheControl for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Value Params
cacheControl

the cache control for the stream.

expectedState

the state that the stream is expected to in. See StreamState for details.

id

the id of the stream.

def setCustom[T](id: Id, expectedState: StreamState, custom: T)(implicit evidence$2: AsObject[T]): F[WriteResult]

Sets a custom JSON metadata value for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Sets a custom JSON metadata value for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Value Params
custom

the custom JSON value using the provided io.circe.Encoder.AsObject encoder.

expectedState

the state that the stream is expected to in. See StreamState for details.

id

the id of the stream.

def setMaxAge(id: Id, expectedState: StreamState, age: MaxAge): F[WriteResult]

Sets MaxAge for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Sets MaxAge for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Value Params
age

the max age for data in the stream.

expectedState

the state that the stream is expected to in. See StreamState for details.

id

the id of the stream.

def setMaxCount(id: Id, expectedState: StreamState, count: MaxCount): F[WriteResult]

Sets MaxCount for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Sets MaxCount for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Value Params
count

the max count of data in the stream.

expectedState

the state that the stream is expected to in. See StreamState for details.

id

the id of the stream.

def setTruncateBefore(id: Id, expectedState: StreamState, truncateBefore: Exact): F[WriteResult]

Sets StreamPosition truncated value for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Sets StreamPosition truncated value for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Value Params
expectedState

the state that the stream is expected to in. See StreamState for details.

id

the id of the stream.

truncateBefore

the truncated before stream position for the stream, the value used entails that events with a stream position less than the truncated before value should be removed.

def unsetAcl(id: Id, expectedState: StreamState): F[WriteResult]

Removes StreamAcl for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Removes StreamAcl for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Value Params
expectedState

the state that the stream is expected to in. See StreamState for details.

id

the id of the stream.

def unsetCacheControl(id: Id, expectedState: StreamState): F[WriteResult]

Removes CacheControl for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Removes CacheControl for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Value Params
expectedState

the state that the stream is expected to in. See StreamState for details.

id

the id of the stream.

def unsetCustom(id: Id, expectedState: StreamState): F[WriteResult]

Removes custom JSON metadata value for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Removes custom JSON metadata value for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Value Params
expectedState

the state that the stream is expected to in. See StreamState for details.

id

the id of the stream.

Note

Removing custom JSON metadata does not affect other metadata values.

def unsetMaxAge(id: Id, expectedState: StreamState): F[WriteResult]

Removes MaxAge for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Removes MaxAge for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Value Params
expectedState

the state that the stream is expected to in. See StreamState for details.

id

the id of the stream.

def unsetMaxCount(id: Id, expectedState: StreamState): F[WriteResult]

Removes MaxCount for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Removes MaxCount for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Value Params
expectedState

the state that the stream is expected to in. See StreamState for details.

id

the id of the stream.

def unsetTruncateBefore(id: Id, expectedState: StreamState): F[WriteResult]

Removes StreamPosition truncated value for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Removes StreamPosition truncated value for a stream and returns WriteResult with current positions of the stream after a successful operation. Failure to fulfill the expected state is manifested by raising sec.api.exceptions.WrongExpectedState.

Value Params
expectedState

the state that the stream is expected to in. See StreamState for details.

id

the id of the stream.

def withCredentials(creds: UserCredentials): MetaStreams[F]

Returns an instance that uses provided UserCredentials. This is useful when an operation requires different credentials from what is provided through configuration.

Returns an instance that uses provided UserCredentials. This is useful when an operation requires different credentials from what is provided through configuration.

Value Params
creds

Custom user credentials to use.