Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype MessageId = MessageId {}
- newMessageId :: IO MessageId
- newtype MessageType = MessageType {}
- messageTypeOf :: forall payload. Typeable payload => MessageType
- newtype StreamPosition = StreamPosition {}
- newtype GlobalPosition = GlobalPosition {}
- newtype CreatedAt = CreatedAt {}
- newtype Payload = Payload {}
- nullPayload :: Payload
- parsePayload :: FromJSON value => Payload -> Either String value
- newtype Metadata = Metadata {}
- nullMetadata :: Metadata
- parseMetadata :: FromJSON value => Metadata -> Either String value
- data Message = Message {}
- data ParseMessageFailure = ParseMessageFailure {}
- data ParsedMessage payload metadata = ParsedMessage {
- parsedPayload :: payload
- parsedMetadata :: metadata
- parseMessage :: (FromJSON payload, FromJSON metadata) => Message -> Either ParseMessageFailure (ParsedMessage payload metadata)
Documentation
Unique id of a message. Most be unique across the entire event store.
newMessageId :: IO MessageId Source #
Create a new unique message id.
newtype MessageType Source #
The type of a message. You can use this later to determine what kind of event or command a message is.
Instances
messageTypeOf :: forall payload. Typeable payload => MessageType Source #
Converts a type's name to a MessageType
. For example 'typeOf @Bool' will be 'MessageType Bool'.
newtype StreamPosition Source #
Position within a stream. This starts at 0 and has no gaps.
Instances
newtype GlobalPosition Source #
Primary key. The ordinal position of the message in the entire message store. Global position may have gaps.
Instances
Timestamp when the message was written.
data ParseMessageFailure Source #
Instances
Eq ParseMessageFailure Source # | |
Defined in MessageDb.Message (==) :: ParseMessageFailure -> ParseMessageFailure -> Bool # (/=) :: ParseMessageFailure -> ParseMessageFailure -> Bool # | |
Show ParseMessageFailure Source # | |
Defined in MessageDb.Message showsPrec :: Int -> ParseMessageFailure -> ShowS # show :: ParseMessageFailure -> String # showList :: [ParseMessageFailure] -> ShowS # | |
Exception ParseMessageFailure Source # | |
Defined in MessageDb.Message |
data ParsedMessage payload metadata Source #
ParsedMessage | |
|
Instances
(Eq payload, Eq metadata) => Eq (ParsedMessage payload metadata) Source # | |
Defined in MessageDb.Message (==) :: ParsedMessage payload metadata -> ParsedMessage payload metadata -> Bool # (/=) :: ParsedMessage payload metadata -> ParsedMessage payload metadata -> Bool # | |
(Show payload, Show metadata) => Show (ParsedMessage payload metadata) Source # | |
Defined in MessageDb.Message showsPrec :: Int -> ParsedMessage payload metadata -> ShowS # show :: ParsedMessage payload metadata -> String # showList :: [ParsedMessage payload metadata] -> ShowS # |
parseMessage :: (FromJSON payload, FromJSON metadata) => Message -> Either ParseMessageFailure (ParsedMessage payload metadata) Source #