Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- newtype StreamName = StreamName {}
- data CategoryName
- categoryOfStream :: StreamName -> CategoryName
- categoryNameToText :: CategoryName -> Text
- categoryName :: Text -> CategoryName
- newtype IdentityName = IdentityName {}
- identityOfStream :: StreamName -> Maybe IdentityName
- addIdentityToCategory :: CategoryName -> IdentityName -> StreamName
- addMaybeIdentityToCategory :: CategoryName -> Maybe IdentityName -> StreamName
Documentation
newtype StreamName Source #
Name of a stream.
Instances
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".
Instances
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
.
categoryName :: Text -> CategoryName Source #
newtype IdentityName Source #
The identifier part of a stream name. Anything after the first hypen (-).
Instances
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.