message-db-0.1.0.0: Client library for Message-DB installed in PostgreSQL.
Safe HaskellNone
LanguageHaskell2010

MessageDb.StreamName

Description

Streams are the fundamental unit of organization of evented, service-oriented systems. They are both the storage and the transport of messages in message-based systems. And they are the principle storage medium of applicative entity data.

Streams are created by writing a message to the stream. Messages are appended to the end of streams. If the stream doesn't exist when an event is appended to it, the event will be appended at position 0. If the stream already exists, the event will be appended at the next position number.

Read more at: http://docs.eventide-project.org/core-concepts/streams

Synopsis

Documentation

newtype StreamName Source #

Name of a stream.

Constructors

StreamName 

Instances

Instances details
Eq StreamName Source # 
Instance details

Defined in MessageDb.StreamName

Ord StreamName Source # 
Instance details

Defined in MessageDb.StreamName

Show StreamName Source # 
Instance details

Defined in MessageDb.StreamName

IsString StreamName Source # 
Instance details

Defined in MessageDb.StreamName

Semigroup StreamName Source # 
Instance details

Defined in MessageDb.StreamName

ToJSON StreamName Source # 
Instance details

Defined in MessageDb.StreamName

FromJSON StreamName Source # 
Instance details

Defined in MessageDb.StreamName

data CategoryName Source #

A category stream name does not have an ID. For example, the stream name for the category of all accounts is "account".

categoryOfStream :: StreamName -> CategoryName Source #

Gets the category of a stream. For example for "account-123" it would return "account".

categoryNameToText :: CategoryName -> Text Source #

Converts from a CategoryName to a nromal Text.

identityOfStream :: StreamName -> Maybe IdentityName Source #

Gets the identifier of a stream from a StreamName. For example "account-ed3b4af7-b4a0-499e-8a16-a09763811274" would return Just "ed3b4af7-b4a0-499e-8a16-a09763811274", and "account" would return Nothing.

addIdentityToCategory :: CategoryName -> IdentityName -> StreamName Source #

Add an identifier to a CategoryName. For example category "account" and identity "123" would return "account-123".

addMaybeIdentityToCategory :: CategoryName -> Maybe IdentityName -> StreamName Source #

Add a maybe identifier, allowing you to add an identifier to the stream name if it is Just.