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

MessageDb.Message

Synopsis

Documentation

newtype MessageId Source #

Unique id of a message. Most be unique across the entire event store.

Constructors

MessageId 

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.

Constructors

MessageType 

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

Instances details
Enum StreamPosition Source # 
Instance details

Defined in MessageDb.Message

Eq StreamPosition Source # 
Instance details

Defined in MessageDb.Message

Integral StreamPosition Source # 
Instance details

Defined in MessageDb.Message

Num StreamPosition Source # 
Instance details

Defined in MessageDb.Message

Ord StreamPosition Source # 
Instance details

Defined in MessageDb.Message

Real StreamPosition Source # 
Instance details

Defined in MessageDb.Message

Show StreamPosition Source # 
Instance details

Defined in MessageDb.Message

ToJSON StreamPosition Source # 
Instance details

Defined in MessageDb.Message

FromJSON StreamPosition Source # 
Instance details

Defined in MessageDb.Message

newtype GlobalPosition Source #

Primary key. The ordinal position of the message in the entire message store. Global position may have gaps.

Instances

Instances details
Enum GlobalPosition Source # 
Instance details

Defined in MessageDb.Message

Eq GlobalPosition Source # 
Instance details

Defined in MessageDb.Message

Integral GlobalPosition Source # 
Instance details

Defined in MessageDb.Message

Num GlobalPosition Source # 
Instance details

Defined in MessageDb.Message

Ord GlobalPosition Source # 
Instance details

Defined in MessageDb.Message

Real GlobalPosition Source # 
Instance details

Defined in MessageDb.Message

Show GlobalPosition Source # 
Instance details

Defined in MessageDb.Message

ToJSON GlobalPosition Source # 
Instance details

Defined in MessageDb.Message

FromJSON GlobalPosition Source # 
Instance details

Defined in MessageDb.Message

newtype CreatedAt Source #

Timestamp when the message was written.

Constructors

CreatedAt 

newtype Payload Source #

Constructors

Payload 

Instances

Instances details
Eq Payload Source # 
Instance details

Defined in MessageDb.Message

Methods

(==) :: Payload -> Payload -> Bool #

(/=) :: Payload -> Payload -> Bool #

Show Payload Source # 
Instance details

Defined in MessageDb.Message

ToJSON Payload Source # 
Instance details

Defined in MessageDb.Message

FromJSON Payload Source # 
Instance details

Defined in MessageDb.Message

newtype Metadata Source #

Constructors

Metadata 

Instances

Instances details
Eq Metadata Source # 
Instance details

Defined in MessageDb.Message

Show Metadata Source # 
Instance details

Defined in MessageDb.Message

ToJSON Metadata Source # 
Instance details

Defined in MessageDb.Message

FromJSON Metadata Source # 
Instance details

Defined in MessageDb.Message

data ParsedMessage payload metadata Source #

Constructors

ParsedMessage 

Fields

Instances

Instances details
(Eq payload, Eq metadata) => Eq (ParsedMessage payload metadata) Source # 
Instance details

Defined in MessageDb.Message

Methods

(==) :: ParsedMessage payload metadata -> ParsedMessage payload metadata -> Bool #

(/=) :: ParsedMessage payload metadata -> ParsedMessage payload metadata -> Bool #

(Show payload, Show metadata) => Show (ParsedMessage payload metadata) Source # 
Instance details

Defined in MessageDb.Message

Methods

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 #