Copyright | (C) 2017 Yorick Laupa |
---|---|
License | (see the file LICENSE) |
Maintainer | Yorick Laupa <yo.eight@gmail.com> |
Stability | provisional |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Re-exports several modules to ease internal testing.
- data Callback a
- newPromise :: IO (Callback a)
- newCallback :: (Either SomeException a -> IO ()) -> IO (Callback a)
- fulfill :: MonadIO m => Callback a -> a -> m ()
- reject :: (Exception e, MonadIO m) => Callback a -> e -> m ()
- retrieve :: Callback a -> IO a
- tryRetrieve :: Callback a -> IO (Either SomeException a)
- fromEither :: Exception e => Callback a -> Either e a -> IO ()
- data Command = Command {}
- heartbeatRequestCmd :: Command
- heartbeatResponseCmd :: Command
- writeEventsCmd :: Command
- writeEventsCompletedCmd :: Command
- transactionStartCmd :: Command
- transactionStartCompletedCmd :: Command
- transactionWriteCmd :: Command
- transactionWriteCompletedCmd :: Command
- transactionCommitCmd :: Command
- transactionCommitCompletedCmd :: Command
- deleteStreamCmd :: Command
- deleteStreamCompletedCmd :: Command
- readEventCmd :: Command
- readEventCompletedCmd :: Command
- readStreamEventsForwardCmd :: Command
- readStreamEventsForwardCompletedCmd :: Command
- readStreamEventsBackwardCmd :: Command
- readStreamEventsBackwardCompletedCmd :: Command
- readAllEventsForwardCmd :: Command
- readAllEventsForwardCompletedCmd :: Command
- readAllEventsBackwardCmd :: Command
- readAllEventsBackwardCompletedCmd :: Command
- subscribeToStreamCmd :: Command
- subscriptionConfirmationCmd :: Command
- streamEventAppearedCmd :: Command
- unsubscribeFromStreamCmd :: Command
- subscriptionDroppedCmd :: Command
- connectToPersistentSubscriptionCmd :: Command
- persistentSubscriptionConfirmationCmd :: Command
- persistentSubscriptionStreamEventAppearedCmd :: Command
- createPersistentSubscriptionCmd :: Command
- createPersistentSubscriptionCompletedCmd :: Command
- deletePersistentSubscriptionCmd :: Command
- deletePersistentSubscriptionCompletedCmd :: Command
- persistentSubscriptionAckEventsCmd :: Command
- persistentSubscriptionNakEventsCmd :: Command
- updatePersistentSubscriptionCmd :: Command
- updatePersistentSubscriptionCompletedCmd :: Command
- badRequestCmd :: Command
- notHandledCmd :: Command
- authenticateCmd :: Command
- authenticatedCmd :: Command
- notAuthenticatedCmd :: Command
- identifyClientCmd :: Command
- clientIdentifiedCmd :: Command
- unknownCmd :: Word8 -> Command
- getCommand :: Word8 -> Command
- _cmdDict :: HashMap Word8 Command
- data SystemInit = SystemInit
- data SystemShutdown = SystemShutdown
- data Service
- data Initialized = Initialized Service
- data InitFailed = InitFailed Service
- data FatalException
- = Exception e => FatalException e
- | FatalCondition Text
- data SubmitOperation = SubmitOperation (Callback a) (Operation a)
- data ServiceTerminated = ServiceTerminated Service
- data NewTimer = Typeable e => NewTimer e Duration Bool
- newtype SendPackage = SendPackage Package
- newtype ConnectionBuilder = ConnectionBuilder {
- connect :: EndPoint -> EventStore Connection
- data Connection = Connection {
- connectionId :: ConnectionId
- connectionEndPoint :: EndPoint
- enqueuePackage :: Package -> EventStore ()
- dispose :: EventStore ()
- data RecvOutcome
- data PackageArrived = PackageArrived Connection Package
- data ConnectionError = ConnectionError Connection SomeException
- data ConnectionEstablished = ConnectionEstablished Connection
- data ConnectionClosed = ConnectionClosed Connection SomeException
- newtype ConnectionRef = ConnectionRef {}
- getConnection :: ConnectionRef -> EventStore Connection
- connectionBuilder :: Settings -> IO ConnectionBuilder
- connectionError :: Exception e => Connection -> e -> ConnectionError
- data EventStore a
- runEventStore :: LoggerRef -> Settings -> Bus -> EventStore a -> IO a
- getSettings :: EventStore Settings
- freshUUID :: EventStore UUID
- class Pub p where
- class Sub s where
- data Hub
- data Subscribe
- data Publish
- asPub :: Pub p => p -> Publish
- asSub :: Sub s => s -> Subscribe
- asHub :: (Sub h, Pub h) => h -> Hub
- data Bus
- newBus :: LoggerRef -> Settings -> IO Bus
- busStop :: MonadIO m => Bus -> m ()
- data Message
- toMsg :: Typeable a => a -> Message
- fromMsg :: Typeable a => Message -> Maybe a
- busProcessedEverything :: Bus -> IO ()
- publish :: Typeable a => a -> EventStore ()
- publishWith :: (Pub p, Typeable a, MonadIO m) => p -> a -> m ()
- subscribe :: (Sub s, Typeable a) => s -> (a -> EventStore ()) -> IO ()
- stopBus :: EventStore ()
- publisher :: EventStore Publish
- monitorIncrPkgCount :: EventStore ()
- monitorIncrConnectionDrop :: EventStore ()
- monitorAddDataTransmitted :: Int -> EventStore ()
- monitorIncrForceReconnect :: EventStore ()
- monitorIncrHeartbeatTimeouts :: EventStore ()
- data Flag
- flagWord8 :: Flag -> Word8
- data Credentials = Credentials {}
- credentials :: ByteString -> ByteString -> Credentials
- data Retry
- atMost :: Int -> Retry
- keepRetrying :: Retry
- data Settings = Settings {
- s_heartbeatInterval :: NominalDiffTime
- s_heartbeatTimeout :: NominalDiffTime
- s_requireMaster :: Bool
- s_credentials :: Maybe Credentials
- s_retry :: Retry
- s_reconnect_delay :: NominalDiffTime
- s_ssl :: Maybe TLSSettings
- s_loggerType :: LogType
- s_loggerFilter :: LoggerFilter
- s_loggerDetailed :: Bool
- s_operationTimeout :: NominalDiffTime
- s_operationRetry :: Retry
- s_monitoring :: Maybe Store
- defaultSettings :: Settings
- defaultSSLSettings :: TLSSettings -> Settings
- msDiffTime :: Float -> NominalDiffTime
- newtype Discovery = Discovery {}
- data GossipSeed
- data DnsDiscoveryException
- data ClusterSettings = ClusterSettings {}
- data DnsServer
- data EndPoint = EndPoint {
- endPointIp :: !String
- endPointPort :: !Int
- staticEndPointDiscovery :: String -> Int -> Discovery
- clusterDnsEndPointDiscovery :: ClusterSettings -> IO Discovery
- gossipSeedClusterSettings :: NonEmpty GossipSeed -> ClusterSettings
- simpleDnsEndPointDiscovery :: ByteString -> Maybe DnsServer -> Int -> Discovery
- dnsClusterSettings :: ByteString -> ClusterSettings
- gossipSeed :: String -> Int -> GossipSeed
- gossipSeedWithHeader :: String -> Int -> String -> GossipSeed
- gossipSeedHeader :: GossipSeed -> String
- gossipSeedHost :: GossipSeed -> String
- gossipSeedPort :: GossipSeed -> Int
- data EndPoint = EndPoint {
- endPointIp :: !String
- endPointPort :: !Int
- emptyEndPoint :: EndPoint
- data NodeEndPoints = NodeEndPoints {
- tcpEndPoint :: !EndPoint
- secureEndPoint :: !(Maybe EndPoint)
- data Exec
- newtype Terminated = Terminated String
- newExec :: Settings -> Bus -> ConnectionBuilder -> Discovery -> IO Exec
- execSettings :: Exec -> Settings
- execWaitTillClosed :: Exec -> IO ()
- data LoggerRef
- data LoggerFilter
- = LoggerFilter (LogSource -> LogLevel -> Bool)
- | LoggerLevel LogLevel
- newLoggerRef :: LogType -> LoggerFilter -> Bool -> IO LoggerRef
- loggerCallback :: LoggerRef -> Loc -> LogSource -> LogLevel -> LogStr -> IO ()
- module Control.Monad.Logger
- module Data.String.Interpolate.IsString
- module System.Log.FastLogger
- data CatchupState
- data CatchupOpResult = CatchupOpResult {}
- data Checkpoint
- catchup :: Settings -> CatchupState -> Bool -> Maybe Int32 -> Operation SubAction
- newtype DeleteResult = DeleteResult Position
- deleteStream :: Settings -> Text -> ExpectedVersion -> Maybe Bool -> Operation DeleteResult
- createPersist :: Text -> Text -> PersistentSubscriptionSettings -> Operation (Maybe PersistActionException)
- updatePersist :: Text -> Text -> PersistentSubscriptionSettings -> Operation (Maybe PersistActionException)
- deletePersist :: Text -> Text -> Operation (Maybe PersistActionException)
- readAllEvents :: Settings -> Int64 -> Int64 -> Int32 -> Bool -> ReadDirection -> Operation AllSlice
- data ReadEvent
- = ReadEventNotFound {
- readEventStream :: !Text
- readEventNumber :: !Int32
- | ReadEvent { }
- = ReadEventNotFound {
- readEvent :: Settings -> Text -> Int32 -> Bool -> Operation (ReadResult RegularStream ReadEvent)
- readStreamEvents :: Settings -> ReadDirection -> Text -> Int32 -> Int32 -> Bool -> Operation (ReadResult RegularStream StreamSlice)
- readMetaStream :: Settings -> Text -> Operation StreamMetadataResult
- setMetaStream :: Settings -> Text -> ExpectedVersion -> StreamMetadata -> Operation WriteResult
- transactionStart :: Settings -> Text -> ExpectedVersion -> Operation Int64
- transactionWrite :: Settings -> Text -> ExpectedVersion -> Int64 -> [Event] -> Operation ()
- transactionCommit :: Settings -> Text -> ExpectedVersion -> Int64 -> Operation WriteResult
- writeEvents :: Settings -> Text -> ExpectedVersion -> [Event] -> Operation WriteResult
- class IsString a where
- class Semigroup a where
- class Monad m => MonadIO m where
- class Hashable a where
- class Monoid a where
- newtype Down a :: * -> * = Down a
- data HashMap k v :: * -> * -> *
- data Seq a :: * -> *
- data Set a :: * -> *
- data ByteString :: *
- data Text :: *
- class Generic a
- class Applicative f => Alternative f where
- class MonadBase b m => MonadBaseControl b m | m -> b where
- atomically :: MonadIO m => STM a -> m a
- zip :: [a] -> [b] -> [(a, b)]
- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- tshow :: Show a => a -> Text
- length :: MonoFoldable mono => mono -> Int
- lift :: MonadTrans t => forall m a. Monad m => m a -> t m a
- retrySTM :: STM a
- fromMaybe :: a -> Maybe a -> a
- unlessM :: Monad m => m Bool -> m () -> m ()
- whenM :: Monad m => m Bool -> m () -> m ()
- isJust :: Maybe a -> Bool
- null :: MonoFoldable mono => mono -> Bool
- module Prelude
- module Control.Applicative
- module Data.Int
- module Data.Foldable
- module Data.Traversable
- module Control.Concurrent.Lifted
- module Control.Concurrent.Async.Lifted
- module Control.Concurrent.MVar.Lifted
- module Control.Concurrent.STM
- module Control.Concurrent.STM.TBMQueue
- module Control.Exception.Safe
- module Control.Monad
- module Control.Monad.Base
- module Control.Monad.Catch
- module Control.Monad.Trans.Control
- module Data.Containers
- module Data.Functor
- module Data.IORef.Lifted
- module Data.Sequences
- module Data.Time
- module Data.Typeable
- module Data.Word
- data Flag
- flagWord8 :: Flag -> Word8
- data Credentials = Credentials {}
- credentials :: ByteString -> ByteString -> Credentials
- data Retry
- atMost :: Int -> Retry
- keepRetrying :: Retry
- data Settings = Settings {
- s_heartbeatInterval :: NominalDiffTime
- s_heartbeatTimeout :: NominalDiffTime
- s_requireMaster :: Bool
- s_credentials :: Maybe Credentials
- s_retry :: Retry
- s_reconnect_delay :: NominalDiffTime
- s_ssl :: Maybe TLSSettings
- s_loggerType :: LogType
- s_loggerFilter :: LoggerFilter
- s_loggerDetailed :: Bool
- s_operationTimeout :: NominalDiffTime
- s_operationRetry :: Retry
- s_monitoring :: Maybe Store
- defaultSettings :: Settings
- defaultSSLSettings :: TLSSettings -> Settings
- msDiffTime :: Float -> NominalDiffTime
- data InternalException = ConnectionClosedByServer
- data EventType
- eventTypeText :: EventType -> Text
- eventTypeFromStr :: String -> EventType
- data Event = Event {}
- createEvent :: EventType -> Maybe UUID -> EventData -> Event
- data EventData
- = Json Value (Maybe Value)
- | Binary ByteString (Maybe ByteString)
- eventDataType :: EventData -> Int32
- eventMetadataType :: EventData -> Int32
- withJson :: ToJSON a => a -> EventData
- withBinary :: ByteString -> EventData
- withJsonAndMetadata :: (ToJSON a, ToJSON b) => a -> b -> EventData
- withBinaryAndMetadata :: ByteString -> ByteString -> EventData
- eventDataBytes :: EventData -> ByteString
- eventMetadataBytes :: EventData -> Maybe ByteString
- data ExpectedVersion
- = Any
- | NoStream
- | EmptyStream
- | Exact Int32
- | StreamExists
- expVersionInt32 :: ExpectedVersion -> Int32
- anyVersion :: ExpectedVersion
- noStreamVersion :: ExpectedVersion
- emptyStreamVersion :: ExpectedVersion
- exactEventVersion :: Int32 -> ExpectedVersion
- streamExists :: ExpectedVersion
- data NewEvent = NewEvent {
- newEventId :: Required 1 (Value ByteString)
- newEventType :: Required 2 (Value Text)
- newEventDataType :: Required 3 (Value Int32)
- newEventMetadataType :: Required 4 (Value Int32)
- newEventData :: Required 5 (Value ByteString)
- newEventMetadata :: Optional 6 (Value ByteString)
- newEvent :: Text -> UUID -> Int32 -> Int32 -> ByteString -> Maybe ByteString -> NewEvent
- data EventRecord = EventRecord {
- eventRecordStreamId :: Required 1 (Value Text)
- eventRecordNumber :: Required 2 (Value Int32)
- eventRecordId :: Required 3 (Value ByteString)
- eventRecordType :: Required 4 (Value Text)
- eventRecordDataType :: Required 5 (Value Int32)
- eventRecordMetadataType :: Required 6 (Value Int32)
- eventRecordData :: Required 7 (Value ByteString)
- eventRecordMetadata :: Optional 8 (Value ByteString)
- eventRecordCreated :: Optional 9 (Value Int64)
- eventRecordCreatedEpoch :: Optional 10 (Value Int64)
- data ResolvedIndexedEvent = ResolvedIndexedEvent {}
- data NotHandledReason
- data MasterInfoBuf = MasterInfoBuf {
- bufMasterExternalTcpAddr :: Required 1 (Value Text)
- bufMasterExternalTcpPort :: Required 2 (Value Int32)
- bufMasterExternalHttpAddr :: Required 3 (Value Text)
- bufMasterExternalHttpPort :: Required 4 (Value Int32)
- bufMasterExternalSecureTcpAddr :: Optional 5 (Value Text)
- bufMasterExternalSecureTcpPort :: Optional 6 (Value Int32)
- data MasterInfo = MasterInfo {}
- masterInfo :: MasterInfoBuf -> MasterInfo
- masterInfoNodeEndPoints :: MasterInfo -> NodeEndPoints
- data NotHandledBuf = NotHandledBuf {}
- data ResolvedEventBuf = ResolvedEventBuf {}
- data Position = Position {
- positionCommit :: !Int64
- positionPrepare :: !Int64
- positionStart :: Position
- positionEnd :: Position
- data RecordedEvent = RecordedEvent {}
- recordedEventDataAsJson :: FromJSON a => RecordedEvent -> Maybe a
- toUTC :: Int64 -> UTCTime
- newRecordedEvent :: EventRecord -> RecordedEvent
- data ResolvedEvent = ResolvedEvent {}
- newResolvedEvent :: ResolvedIndexedEvent -> ResolvedEvent
- newResolvedEventFromBuf :: ResolvedEventBuf -> ResolvedEvent
- resolvedEventOriginal :: ResolvedEvent -> RecordedEvent
- resolvedEventDataAsJson :: FromJSON a => ResolvedEvent -> Maybe a
- isEventResolvedLink :: ResolvedEvent -> Bool
- resolvedEventOriginalStreamId :: ResolvedEvent -> Text
- resolvedEventOriginalId :: ResolvedEvent -> UUID
- resolvedEventOriginalEventNumber :: ResolvedEvent -> Int32
- data ReadDirection
- data Package = Package {
- packageCmd :: !Command
- packageCorrelation :: !UUID
- packageData :: !ByteString
- packageCred :: !(Maybe Credentials)
- packageDataAsText :: Package -> Maybe Text
- heartbeatRequestPackage :: UUID -> Package
- heartbeatResponsePackage :: UUID -> Package
- data StreamACL = StreamACL {
- streamACLReadRoles :: ![Text]
- streamACLWriteRoles :: ![Text]
- streamACLDeleteRoles :: ![Text]
- streamACLMetaReadRoles :: ![Text]
- streamACLMetaWriteRoles :: ![Text]
- emptyStreamACL :: StreamACL
- data StreamMetadata = StreamMetadata {}
- getCustomPropertyValue :: StreamMetadata -> Text -> Maybe Value
- getCustomProperty :: FromJSON a => StreamMetadata -> Text -> Maybe a
- emptyStreamMetadata :: StreamMetadata
- customMetaToPairs :: Object -> [Pair]
- streamACLJSON :: StreamACL -> Value
- streamMetadataJSON :: StreamMetadata -> Value
- p_readRoles :: Text
- p_writeRoles :: Text
- p_deleteRoles :: Text
- p_metaReadRoles :: Text
- p_metaWriteRoles :: Text
- p_maxAge :: Text
- p_maxCount :: Text
- p_truncateBefore :: Text
- p_cacheControl :: Text
- p_acl :: Text
- internalMetaProperties :: Set Text
- keepUserProperties :: Object -> Object
- parseNominalDiffTime :: Text -> Object -> Parser (Maybe NominalDiffTime)
- parseStreamACL :: Value -> Parser StreamACL
- parseStreamMetadata :: Value -> Parser StreamMetadata
- type Builder a = Endo a
- build :: a -> Builder a -> a
- type StreamACLBuilder = Builder StreamACL
- setReadRoles :: [Text] -> StreamACLBuilder
- setReadRole :: Text -> StreamACLBuilder
- setWriteRoles :: [Text] -> StreamACLBuilder
- setWriteRole :: Text -> StreamACLBuilder
- setDeleteRoles :: [Text] -> StreamACLBuilder
- setDeleteRole :: Text -> StreamACLBuilder
- setMetaReadRoles :: [Text] -> StreamACLBuilder
- setMetaReadRole :: Text -> StreamACLBuilder
- setMetaWriteRoles :: [Text] -> StreamACLBuilder
- setMetaWriteRole :: Text -> StreamACLBuilder
- buildStreamACL :: StreamACLBuilder -> StreamACL
- modifyStreamACL :: StreamACLBuilder -> StreamACL -> StreamACL
- type StreamMetadataBuilder = Builder StreamMetadata
- setMaxCount :: Int32 -> StreamMetadataBuilder
- setMaxAge :: TimeSpan -> StreamMetadataBuilder
- setTruncateBefore :: Int32 -> StreamMetadataBuilder
- setCacheControl :: TimeSpan -> StreamMetadataBuilder
- setACL :: StreamACL -> StreamMetadataBuilder
- modifyACL :: StreamACLBuilder -> StreamMetadataBuilder
- setCustomProperty :: ToJSON a => Text -> a -> StreamMetadataBuilder
- buildStreamMetadata :: StreamMetadataBuilder -> StreamMetadata
- modifyStreamMetadata :: StreamMetadataBuilder -> StreamMetadata -> StreamMetadata
- data StreamMetadataResult
- data SystemConsumerStrategy
- strategyText :: SystemConsumerStrategy -> Text
- strategyFromText :: Text -> Maybe SystemConsumerStrategy
- data PersistentSubscriptionSettings = PersistentSubscriptionSettings {
- psSettingsResolveLinkTos :: !Bool
- psSettingsStartFrom :: !Int32
- psSettingsExtraStats :: !Bool
- psSettingsMsgTimeout :: !TimeSpan
- psSettingsMaxRetryCount :: !Int32
- psSettingsLiveBufSize :: !Int32
- psSettingsReadBatchSize :: !Int32
- psSettingsHistoryBufSize :: !Int32
- psSettingsCheckPointAfter :: !TimeSpan
- psSettingsMinCheckPointCount :: !Int32
- psSettingsMaxCheckPointCount :: !Int32
- psSettingsMaxSubsCount :: !Int32
- psSettingsNamedConsumerStrategy :: !SystemConsumerStrategy
- defaultPersistentSubscriptionSettings :: PersistentSubscriptionSettings
- newtype Duration = Duration Int64
- msDuration :: Int64 -> Duration
- secsDuration :: Int64 -> Duration
Documentation
newPromise :: IO (Callback a) Source #
newCallback :: (Either SomeException a -> IO ()) -> IO (Callback a) Source #
tryRetrieve :: Callback a -> IO (Either SomeException a) Source #
Internal command representation.
unknownCmd :: Word8 -> Command Source #
getCommand :: Word8 -> Command Source #
data SystemInit Source #
data FatalException Source #
data SubmitOperation Source #
SubmitOperation (Callback a) (Operation a) |
newtype SendPackage Source #
newtype ConnectionBuilder Source #
data Connection Source #
Connection | |
|
newtype ConnectionRef Source #
connectionError :: Exception e => Connection -> e -> ConnectionError Source #
Control
data EventStore a Source #
runEventStore :: LoggerRef -> Settings -> Bus -> EventStore a -> IO a Source #
Messaging
subscribeEventHandler :: s -> EventHandler -> IO () Source #
busProcessedEverything :: Bus -> IO () Source #
publish :: Typeable a => a -> EventStore () Source #
stopBus :: EventStore () Source #
Monitoring
monitorIncrPkgCount :: EventStore () Source #
monitorAddDataTransmitted :: Int -> EventStore () Source #
Re-export
Indicates either a Package
contains Credentials
data or not.
data Credentials Source #
Holds login and password information.
:: ByteString | Login |
-> ByteString | Password |
-> Credentials |
Creates a Credentials
given a login and a password.
atMost :: Int -> Retry Source #
Indicates how many times we should try to reconnect to the server. A value less than or equal to 0 means no retry.
keepRetrying :: Retry Source #
Indicates we should try to reconnect to the server until the end of the Universe.
Global Connection
settings
Settings | |
|
defaultSettings :: Settings Source #
Default global settings.
s_heartbeatInterval
= 750 mss_heartbeatTimeout
= 1500 mss_requireMaster
=True
s_credentials
=Nothing
s_retry
=atMost
3s_reconnect_delay
= 3 secondss_ssl
=Nothing
s_loggerType
=LogNone
s_loggerFilter
=LoggerLevel
LevelInfo
s_loggerDetailed
=False
s_operationTimeout
= 10 secondss_operationRetry
=atMost
3s_monitoring
=Nothing
defaultSSLSettings :: TLSSettings -> Settings Source #
Default SSL settings based on defaultSettings
.
msDiffTime :: Float -> NominalDiffTime Source #
Millisecond timespan
Procedure used to discover an network EndPoint
.
data DnsDiscoveryException Source #
data ClusterSettings Source #
Contains settings related to a connection to a cluster.
ClusterSettings | |
|
Tells how the DNS server should be contacted.
Gathers both an IPv4 and a port.
EndPoint | |
|
gossipSeedClusterSettings :: NonEmpty GossipSeed -> ClusterSettings Source #
Configures a ClusterSettings
for connecting to a cluster using gossip
seeds.
clusterDns = ""
clusterMaxDiscoverAttempts = 10
clusterExternalGossipPort = 0
clusterGossipTimeout = 1s
simpleDnsEndPointDiscovery :: ByteString -> Maybe DnsServer -> Int -> Discovery Source #
dnsClusterSettings :: ByteString -> ClusterSettings Source #
Configures a ClusterSettings
for connecting to a cluster using DNS
discovery.
clusterMaxDiscoverAttempts = 10
clusterExternalGossipPort = 0
clusterGossipSeeds = Nothing
clusterGossipTimeout = 1s
gossipSeed :: String -> Int -> GossipSeed Source #
Creates a GossipSeed
.
gossipSeedWithHeader :: String -> Int -> String -> GossipSeed Source #
Creates a GossipSeed
with a specific HTTP header.
gossipSeedHeader :: GossipSeed -> String Source #
The host header to be sent when requesting gossip.
gossipSeedHost :: GossipSeed -> String Source #
Returns GossipSeed
host IP address.
gossipSeedPort :: GossipSeed -> Int Source #
Returns GossipSeed
port.
Gathers both an IPv4 and a port.
EndPoint | |
|
data NodeEndPoints Source #
NodeEndPoints | |
|
execSettings :: Exec -> Settings Source #
execWaitTillClosed :: Exec -> IO () Source #
data LoggerFilter Source #
LoggerFilter (LogSource -> LogLevel -> Bool) | |
LoggerLevel LogLevel |
newLoggerRef :: LogType -> LoggerFilter -> Bool -> IO LoggerRef Source #
module Control.Monad.Logger
module System.Log.FastLogger
data CatchupState Source #
Catchup operation state.
RegularCatchup Text Int32 | Indicates the stream name and the next event number to start from. |
AllCatchup Position | Indicates the commit and prepare position. Used when catching up from the $all stream. |
data CatchupOpResult Source #
data Checkpoint Source #
catchup :: Settings -> CatchupState -> Bool -> Maybe Int32 -> Operation SubAction Source #
Stream catching up operation.
newtype DeleteResult Source #
Returned after deleting a stream. Position
of the write.
deleteStream :: Settings -> Text -> ExpectedVersion -> Maybe Bool -> Operation DeleteResult Source #
Delete a regular stream operation.
createPersist :: Text -> Text -> PersistentSubscriptionSettings -> Operation (Maybe PersistActionException) Source #
updatePersist :: Text -> Text -> PersistentSubscriptionSettings -> Operation (Maybe PersistActionException) Source #
deletePersist :: Text -> Text -> Operation (Maybe PersistActionException) Source #
readAllEvents :: Settings -> Int64 -> Int64 -> Int32 -> Bool -> ReadDirection -> Operation AllSlice Source #
Batch read on $all stream operation.
Represents the result of looking up a specific event number from a stream.
readEvent :: Settings -> Text -> Int32 -> Bool -> Operation (ReadResult RegularStream ReadEvent) Source #
Read a specific event given event number operation.
readStreamEvents :: Settings -> ReadDirection -> Text -> Int32 -> Int32 -> Bool -> Operation (ReadResult RegularStream StreamSlice) Source #
Batch read from a regular stream operation.
readMetaStream :: Settings -> Text -> Operation StreamMetadataResult Source #
Read stream metadata operation.
setMetaStream :: Settings -> Text -> ExpectedVersion -> StreamMetadata -> Operation WriteResult Source #
Set stream metadata operation.
transactionStart :: Settings -> Text -> ExpectedVersion -> Operation Int64 Source #
Start transaction operation.
transactionWrite :: Settings -> Text -> ExpectedVersion -> Int64 -> [Event] -> Operation () Source #
Transactional write operation.
transactionCommit :: Settings -> Text -> ExpectedVersion -> Int64 -> Operation WriteResult Source #
Transactional commit operation.
writeEvents :: Settings -> Text -> ExpectedVersion -> [Event] -> Operation WriteResult Source #
Write events operation.
Class for string-like datastructures; used by the overloaded string extension (-XOverloadedStrings in GHC).
fromString :: String -> a #
IsString ByteString | |
IsString ByteString | |
IsString Value | |
IsString LogStr | |
IsString String | |
IsString RequestBody | Since 0.4.12 |
IsString IPRange | |
IsString IP | |
IsString IPv4 | |
IsString IPv6 | |
IsString Doc | |
IsString StreamName # | |
IsString EventType # | |
(~) * a Char => IsString [a] | |
IsString a => IsString (Identity a) | |
IsString (Seq Char) | |
(~) * a Char => IsString (DList a) | |
(IsString a, Hashable a) => IsString (Hashed a) | |
IsString (AddrRange IPv4) | |
IsString (AddrRange IPv6) | |
IsString (Doc a) | |
IsString a => IsString (Const * a b) | |
IsString a => IsString (Tagged k s a) | |
The class of semigroups (types with an associative binary operation).
Since: 4.9.0.0
(<>) :: a -> a -> a infixr 6 #
An associative operation.
(a<>
b)<>
c = a<>
(b<>
c)
If a
is also a Monoid
we further require
(<>
) =mappend
Reduce a non-empty list with <>
The default definition should be sufficient, but this can be overridden for efficiency.
stimes :: Integral b => b -> a -> a #
Repeat a value n
times.
Given that this works on a Semigroup
it is allowed to fail if
you request 0 or fewer repetitions, and the default definition
will do so.
By making this a member of the class, idempotent semigroups and monoids can
upgrade this to execute in O(1) by picking
stimes = stimesIdempotent
or stimes = stimesIdempotentMonoid
respectively.
class Monad m => MonadIO m where #
Monads in which IO
computations may be embedded.
Any monad built by applying a sequence of monad transformers to the
IO
monad will be an instance of this class.
Instances should satisfy the following laws, which state that liftIO
is a transformer of monads:
MonadIO IO | |
MonadIO EventStore # | |
MonadIO m => MonadIO (MaybeT m) | |
MonadIO m => MonadIO (ListT m) | |
MonadIO m => MonadIO (NoLoggingT m) | |
MonadIO m => MonadIO (LoggingT m) | |
MonadIO m => MonadIO (ResourceT m) | |
MonadIO m => MonadIO (IdentityT * m) | |
(Monoid w, MonadIO m) => MonadIO (WriterT w m) | |
(Monoid w, MonadIO m) => MonadIO (WriterT w m) | |
MonadIO m => MonadIO (StateT s m) | |
MonadIO m => MonadIO (StateT s m) | |
(Error e, MonadIO m) => MonadIO (ErrorT e m) | |
MonadIO m => MonadIO (ExceptT e m) | |
MonadIO m => MonadIO (ReaderT * r m) | |
MonadIO m => MonadIO (ConduitM i o m) | |
MonadIO m => MonadIO (PlanT k o m) | |
MonadIO m => MonadIO (ContT * r m) | |
(Monoid w, MonadIO m) => MonadIO (RWST r w s m) | |
(Monoid w, MonadIO m) => MonadIO (RWST r w s m) | |
MonadIO m => MonadIO (Pipe l i o u m) | |
The class of types that can be converted to a hash value.
Minimal implementation: hashWithSalt
.
hashWithSalt :: Int -> a -> Int infixl 0 #
Return a hash value for the argument, using the given salt.
The general contract of hashWithSalt
is:
- If two values are equal according to the
==
method, then applying thehashWithSalt
method on each of the two values must produce the same integer result if the same salt is used in each case. - It is not required that if two values are unequal
according to the
==
method, then applying thehashWithSalt
method on each of the two values must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal values may improve the performance of hashing-based data structures. - This method can be used to compute different hash values for
the same input by providing a different salt in each
application of the method. This implies that any instance
that defines
hashWithSalt
must make use of the salt in its implementation.
Like hashWithSalt
, but no salt is used. The default
implementation uses hashWithSalt
with some default salt.
Instances might want to implement this method to provide a more
efficient implementation than the default implementation.
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:
mappend mempty x = x
mappend x mempty = x
mappend x (mappend y z) = mappend (mappend x y) z
mconcat =
foldr
mappend mempty
The method names refer to the monoid of lists under concatenation, but there are many other instances.
Some types can be viewed as a monoid in more than one way,
e.g. both addition and multiplication on numbers.
In such cases we often define newtype
s and make those instances
of Monoid
, e.g. Sum
and Product
.
Identity of mappend
An associative operation
Fold a list using the monoid.
For most types, the default definition for mconcat
will be
used, but the function is included in the class definition so
that an optimized version can be provided for specific types.
The Down
type allows you to reverse sort order conveniently. A value of type
contains a value of type Down
aa
(represented as
).
If Down
aa
has an
instance associated with it then comparing two
values thus wrapped will give you the opposite of their normal sort order.
This is particularly useful when sorting in generalised list comprehensions,
as in: Ord
then sortWith by
Down
x
Provides Show
and Read
instances (since: 4.7.0.0).
Since: 4.6.0.0
Down a |
data HashMap k v :: * -> * -> * #
A map from keys to values. A map cannot contain duplicate keys; each key can map to at most one value.
General-purpose finite sequences.
Monad Seq | |
Functor Seq | |
Applicative Seq | |
Foldable Seq | |
Traversable Seq | |
ToJSON1 Seq | |
FromJSON1 Seq | |
Alternative Seq | |
MonadPlus Seq | |
IsList (Seq a) | |
Eq a => Eq (Seq a) | |
Data a => Data (Seq a) | |
Ord a => Ord (Seq a) | |
Read a => Read (Seq a) | |
Show a => Show (Seq a) | |
IsString (Seq Char) | |
Semigroup (Seq a) | |
Monoid (Seq a) | |
ToJSON a => ToJSON (Seq a) | |
FromJSON a => FromJSON (Seq a) | |
Serialize e => Serialize (Seq e) | |
NFData a => NFData (Seq a) | |
SemiSequence (Seq a) | |
IsSequence (Seq a) | |
MonoFunctor (Seq a) | |
MonoFoldable (Seq a) | |
MonoTraversable (Seq a) | |
MonoPointed (Seq a) | |
GrowingAppend (Seq a) | |
type Item (Seq a) | |
type Index (Seq a) | |
type Element (Seq a) | |
A set of values a
.
Foldable Set | |
ToJSON1 Set | |
Ord a => IsList (Set a) | |
Eq a => Eq (Set a) | |
(Data a, Ord a) => Data (Set a) | |
Ord a => Ord (Set a) | |
(Read a, Ord a) => Read (Set a) | |
Show a => Show (Set a) | |
Ord a => Semigroup (Set a) | |
Ord a => Monoid (Set a) | |
ToJSON a => ToJSON (Set a) | |
(Ord a, FromJSON a) => FromJSON (Set a) | |
(Ord a, Serialize a) => Serialize (Set a) | |
NFData a => NFData (Set a) | |
Ord element => SetContainer (Set element) | |
Ord element => IsSet (Set element) | |
MonoFoldable (Set e) | |
MonoPointed (Set a) | |
Ord v => GrowingAppend (Set v) | |
type Item (Set a) | |
type ContainerKey (Set element) | |
type Element (Set e) | |
data ByteString :: * #
A space-efficient representation of a Word8
vector, supporting many
efficient operations.
A ByteString
contains 8-bit bytes, or by using the operations from
Data.ByteString.Char8 it can be interpreted as containing 8-bit
characters.
A space efficient, packed, unboxed Unicode text type.
Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.
class Applicative f => Alternative f where #
A monoid on applicative functors.
If defined, some
and many
should be the least solutions
of the equations:
The identity of <|>
(<|>) :: f a -> f a -> f a infixl 3 #
An associative binary operation
One or more.
Zero or more.
class MonadBase b m => MonadBaseControl b m | m -> b where #
type StM (m :: * -> *) a :: * #
Monadic state of m
.
For all non-transformer monads, StM m a ~ a
:
StMIO
a ~ a StMMaybe
a ~ a StM (Either
e) a ~ a StM [] a ~ a StM ((->) r) a ~ a StMIdentity
a ~ a StMSTM
a ~ a StM (ST
s) a ~ a
All transformer monads' StM
depends on both the monadic state of the
transformer (given by its StT
from MonadTransControl
), as well as its
inner monad's monadic state, given by its StM
from MonadBaseControl
:
StM (IdentityT
m) a ~ StM m a StM (MaybeT
m) a ~ StM m (Maybe
a) StM (ErrorT
e m) a ~Error
e => StM m (Either
e a) StM (ExceptT
e m) a ~ StM m (Either
e a) StM (ListT
m) a ~ StM m [a] StM (ReaderT
r m) a ~ StM m a StM (StateT
s m) a ~ StM m (a, s) StM (WriterT
w m) a ~Monoid
w => StM m (a, w) StM (RWST
r w s m) a ~Monoid
w => StM m (a, s, w)
liftBaseWith :: (RunInBase m b -> b a) -> m a #
liftBaseWith
is similar to liftIO
and liftBase
in that it
lifts a base computation to the constructed monad.
Instances should satisfy similar laws as the MonadIO
and MonadBase
laws:
liftBaseWith . const . return = return
liftBaseWith (const (m >>= f)) = liftBaseWith (const m) >>= liftBaseWith . const . f
The difference with liftBase
is that before lifting the base computation
liftBaseWith
captures the state of m
. It then provides the base
computation with a RunInBase
function that allows running m
computations in the base monad on the captured state.
Construct a m
computation from the monadic state of m
that is
returned from a RunInBase
function.
Instances should satisfy:
liftBaseWith (\runInBase -> runInBase m) >>= restoreM = m
atomically :: MonadIO m => STM a -> m a Source #
Generalized version of atomically
.
length :: MonoFoldable mono => mono -> Int #
Synonym for olength
Since: 1.0.0
lift :: MonadTrans t => forall m a. Monad m => m a -> t m a #
Lift a computation from the argument monad to the constructed monad.
fromMaybe :: a -> Maybe a -> a #
The fromMaybe
function takes a default value and and Maybe
value. If the Maybe
is Nothing
, it returns the default values;
otherwise, it returns the value contained in the Maybe
.
Examples
Basic usage:
>>>
fromMaybe "" (Just "Hello, World!")
"Hello, World!"
>>>
fromMaybe "" Nothing
""
Read an integer from a string using readMaybe
. If we fail to
parse an integer, we want to return 0
by default:
>>>
import Text.Read ( readMaybe )
>>>
fromMaybe 0 (readMaybe "5")
5>>>
fromMaybe 0 (readMaybe "")
0
unlessM :: Monad m => m Bool -> m () -> m () Source #
Only perform the action if the predicate returns False
.
whenM :: Monad m => m Bool -> m () -> m () Source #
Only perform the action if the predicate returns True
.
null :: MonoFoldable mono => mono -> Bool #
Synonym for onull
Since: 1.0.0
module Prelude
module Control.Applicative
module Data.Int
module Data.Foldable
module Data.Traversable
module Control.Concurrent.Lifted
module Control.Concurrent.STM
module Control.Exception.Safe
module Control.Monad
module Control.Monad.Base
module Control.Monad.Catch
module Control.Monad.Trans.Control
module Data.Containers
module Data.Functor
module Data.IORef.Lifted
module Data.Sequences
module Data.Time
module Data.Typeable
module Data.Word
Indicates either a Package
contains Credentials
data or not.
data Credentials Source #
Holds login and password information.
:: ByteString | Login |
-> ByteString | Password |
-> Credentials |
Creates a Credentials
given a login and a password.
atMost :: Int -> Retry Source #
Indicates how many times we should try to reconnect to the server. A value less than or equal to 0 means no retry.
keepRetrying :: Retry Source #
Indicates we should try to reconnect to the server until the end of the Universe.
Global Connection
settings
Settings | |
|
defaultSettings :: Settings Source #
Default global settings.
s_heartbeatInterval
= 750 mss_heartbeatTimeout
= 1500 mss_requireMaster
=True
s_credentials
=Nothing
s_retry
=atMost
3s_reconnect_delay
= 3 secondss_ssl
=Nothing
s_loggerType
=LogNone
s_loggerFilter
=LoggerLevel
LevelInfo
s_loggerDetailed
=False
s_operationTimeout
= 10 secondss_operationRetry
=atMost
3s_monitoring
=Nothing
defaultSSLSettings :: TLSSettings -> Settings Source #
Default SSL settings based on defaultSettings
.
msDiffTime :: Float -> NominalDiffTime Source #
Millisecond timespan
data InternalException Source #
Represent a class of error where the user is not at fault. It could be either the client or the server.
ConnectionClosedByServer | Happens when the server deliberately close the connection. This probably happens if the client didn't respect EventStore communication error. For instance, the client takes too much time to respond to a heartbeat request. |
Constants for System event types.
StreamDeletedType | Event type for stream deleted. |
StatsCollectionType | Event type for statistics. |
LinkToType | Event type for linkTo. |
StreamMetadataType | Event type for stream metadata. |
SettingsType | Event type for the system settings. |
UserDefined Text | Event defined by the user. |
eventTypeText :: EventType -> Text Source #
eventTypeFromStr :: String -> EventType Source #
Contains event information like its type and data. Only used for write queries.
Create an Event
meant to be persisted.
Holds event data.
eventDataType :: EventData -> Int32 Source #
eventMetadataType :: EventData -> Int32 Source #
withBinary :: ByteString -> EventData Source #
Creates an event using a binary format.
withJsonAndMetadata :: (ToJSON a, ToJSON b) => a -> b -> EventData Source #
Creates an event with metadata using JSON format.
withBinaryAndMetadata :: ByteString -> ByteString -> EventData Source #
Creates an event with metadata using binary format.
eventDataBytes :: EventData -> ByteString Source #
Serializes EventData'
s data to a raw ByteString
.
eventMetadataBytes :: EventData -> Maybe ByteString Source #
Serializes EventData
metadata to a raw ByteString
.
data ExpectedVersion Source #
Constants used for expected version control.
The use of expected version can be a bit tricky especially when discussing idempotency assurances given by the EventStore.
The EventStore will assure idempotency for all operations using any value
in ExpectedVersion
except for anyStream
. When using anyStream
the
EventStore will do its best to assure idempotency but will not guarantee
idempotency.
expVersionInt32 :: ExpectedVersion -> Int32 Source #
Maps a ExpectedVersion
to an Int32
understandable by the server.
anyVersion :: ExpectedVersion Source #
This write should not conflict with anything and should always succeed.
noStreamVersion :: ExpectedVersion Source #
The stream being written to should not yet exist. If it does exist treat that as a concurrency problem.
emptyStreamVersion :: ExpectedVersion Source #
The stream should exist and should be empty. If it does not exist or is not empty, treat that as a concurrency problem.
exactEventVersion :: Int32 -> ExpectedVersion Source #
States that the last event written to the stream should have a sequence number matching your expected value.
streamExists :: ExpectedVersion Source #
The stream should exist. If it or a metadata stream does not exist treat that as a concurrency problem.
Serializes form of an Event
.
NewEvent | |
|
:: Text | Event type |
-> UUID | Event ID |
-> Int32 | Data content type |
-> Int32 | Metadata content type |
-> ByteString | Event data |
-> Maybe ByteString | Metadata |
-> NewEvent |
NewEvent
smart constructor.
data EventRecord Source #
Represents a serialized event coming from the server.
EventRecord | |
|
data ResolvedIndexedEvent Source #
Represents a serialized event representiong either an event or a link event.
data NotHandledReason Source #
data MasterInfoBuf Source #
data MasterInfo Source #
masterInfo :: MasterInfoBuf -> MasterInfo Source #
data ResolvedEventBuf Source #
Represents a serialized event sent by the server in a subscription context.
A structure referring to a potential logical record position in the EventStore transaction file.
Position | |
|
positionStart :: Position Source #
Representing the start of the transaction file.
positionEnd :: Position Source #
Representing the end of the transaction file.
data RecordedEvent Source #
Represents a previously written event.
RecordedEvent | |
|
recordedEventDataAsJson :: FromJSON a => RecordedEvent -> Maybe a Source #
Tries to parse JSON object from the given RecordedEvent
.
toUTC :: Int64 -> UTCTime Source #
Converts a raw Int64
into an UTCTime
fromIntegral should be a no-op in GHC and allow eventstore to compile w GHCJS
GHCJS maps CTime to Int32 (cf PR https://github.com/YoEight/eventstore/pull/47)
newRecordedEvent :: EventRecord -> RecordedEvent Source #
Constructs a RecordedEvent
from an EventRecord
.
data ResolvedEvent Source #
A structure representing a single event or an resolved link event.
ResolvedEvent | |
|
newResolvedEvent :: ResolvedIndexedEvent -> ResolvedEvent Source #
Constructs a ResolvedEvent
from a ResolvedIndexedEvent
.
newResolvedEventFromBuf :: ResolvedEventBuf -> ResolvedEvent Source #
Constructs a ResolvedEvent
from a ResolvedEventBuf
.
resolvedEventOriginal :: ResolvedEvent -> RecordedEvent Source #
Returns the event that was read or which triggered the subscription.
If this ResolvedEvent
represents a link event, the link will be the
original event, otherwise it will be the event.
resolvedEventDataAsJson :: FromJSON a => ResolvedEvent -> Maybe a Source #
Tries to desarialize resolvedEventOriginal
data as JSON.
isEventResolvedLink :: ResolvedEvent -> Bool Source #
Indicates whether this ResolvedEvent
is a resolved link event.
resolvedEventOriginalStreamId :: ResolvedEvent -> Text Source #
The stream name of the original event.
resolvedEventOriginalId :: ResolvedEvent -> UUID Source #
The ID of the original event.
resolvedEventOriginalEventNumber :: ResolvedEvent -> Int32 Source #
The event number of the original event.
data ReadDirection Source #
Represents the direction of read operation (both from $all an usual streams).
Represents a package exchanged between the client and the server.
Package | |
|
heartbeatResponsePackage :: UUID -> Package Source #
Constructs a heartbeat response given the UUID
of heartbeat request.
Represents an access control list for a stream.
StreamACL | |
|
emptyStreamACL :: StreamACL Source #
StreamACL
with no role or users whatsoever.
data StreamMetadata Source #
Represents stream metadata with strongly typed properties for system values and a dictionary-like interface for custom values.
StreamMetadata | |
|
getCustomPropertyValue :: StreamMetadata -> Text -> Maybe Value Source #
Gets a custom property value from metadata.
getCustomProperty :: FromJSON a => StreamMetadata -> Text -> Maybe a Source #
Get a custom property value from metadata.
emptyStreamMetadata :: StreamMetadata Source #
StreamMetadata
with everything set to Nothing
, using emptyStreamACL
and an empty Object
.
customMetaToPairs :: Object -> [Pair] Source #
Maps an Object
to a list of Pair
to ease the StreamMetadata
.
streamACLJSON :: StreamACL -> Value Source #
streamMetadataJSON :: StreamMetadata -> Value Source #
Serialized a StreamMetadata
to Value
for serialization purpose.
p_readRoles :: Text Source #
Read ACL property.
p_writeRoles :: Text Source #
Write ACL property.
p_deleteRoles :: Text Source #
Delete ACL property.
p_metaReadRoles :: Text Source #
Metadata read ACL property.
p_metaWriteRoles :: Text Source #
Metadata write ACL property.
p_maxCount :: Text Source #
Max count metadata property.
p_truncateBefore :: Text Source #
truncated before metadata property.
p_cacheControl :: Text Source #
Cache control metadata property.
internalMetaProperties :: Set Text Source #
Gathers every internal metadata properties into a Set
. It used to safely
StreamMetadata
in JSON.
keepUserProperties :: Object -> Object Source #
Only keeps the properties the users has set.
parseNominalDiffTime :: Text -> Object -> Parser (Maybe NominalDiffTime) Source #
Parses a NominalDiffTime
from an Object
given a JSON property.
parseStreamMetadata :: Value -> Parser StreamMetadata Source #
Parses StreamMetadata
.
setReadRoles :: [Text] -> StreamACLBuilder Source #
Sets role names with read permission for the stream.
setReadRole :: Text -> StreamACLBuilder Source #
Sets a single role name with read permission for the stream.
setWriteRoles :: [Text] -> StreamACLBuilder Source #
Sets role names with write permission for the stream.
setWriteRole :: Text -> StreamACLBuilder Source #
Sets a single role name with write permission for the stream.
setDeleteRoles :: [Text] -> StreamACLBuilder Source #
Sets role names with delete permission for the stream.
setDeleteRole :: Text -> StreamACLBuilder Source #
Sets a single role name with delete permission for the stream.
setMetaReadRoles :: [Text] -> StreamACLBuilder Source #
Sets role names with metadata read permission for the stream.
setMetaReadRole :: Text -> StreamACLBuilder Source #
Sets a single role name with metadata read permission for the stream.
setMetaWriteRoles :: [Text] -> StreamACLBuilder Source #
Sets role names with metadata write permission for the stream.
setMetaWriteRole :: Text -> StreamACLBuilder Source #
Sets a single role name with metadata write permission for the stream.
buildStreamACL :: StreamACLBuilder -> StreamACL Source #
Builds a StreamACL
from a StreamACLBuilder
.
modifyStreamACL :: StreamACLBuilder -> StreamACL -> StreamACL Source #
Modifies a StreamACL
using a StreamACLBuilder
.
type StreamMetadataBuilder = Builder StreamMetadata Source #
A Builder
applies to StreamMetadata
.
setMaxCount :: Int32 -> StreamMetadataBuilder Source #
Sets the maximum number of events allowed in the stream.
setMaxAge :: TimeSpan -> StreamMetadataBuilder Source #
Sets the maximum age of events allowed in the stream.
setTruncateBefore :: Int32 -> StreamMetadataBuilder Source #
Sets the event number from which previous events can be scavenged.
setCacheControl :: TimeSpan -> StreamMetadataBuilder Source #
Sets the amount of time for which the stream head is cachable.
setACL :: StreamACL -> StreamMetadataBuilder Source #
Overwrites any previous StreamACL
by the given one in a
StreamMetadataBuilder
.
modifyACL :: StreamACLBuilder -> StreamMetadataBuilder Source #
Updates a StreamMetadata'
s StreamACL
given a StreamACLBuilder
.
setCustomProperty :: ToJSON a => Text -> a -> StreamMetadataBuilder Source #
Sets a custom metadata property.
buildStreamMetadata :: StreamMetadataBuilder -> StreamMetadata Source #
Builds a StreamMetadata
from a StreamMetadataBuilder
.
modifyStreamMetadata :: StreamMetadataBuilder -> StreamMetadata -> StreamMetadata Source #
Modifies a StreamMetadata
using a StreamMetadataBuilder
data StreamMetadataResult Source #
Represents stream metadata as a series of properties for system data and a
StreamMetadata
object for user metadata.
StreamMetadataResult | |
| |
NotFoundStreamMetadataResult | When the stream is either not found or 'no stream'. |
| |
DeletedStreamMetadataResult | When the stream is soft-deleted. |
|
data SystemConsumerStrategy Source #
System supported consumer strategies for use with persistent subscriptions.
DispatchToSingle | Distributes events to a single client until it is full. Then round robin to the next client. |
RoundRobin | Distributes events to each client in a round robin fashion. |
strategyText :: SystemConsumerStrategy -> Text Source #
Maps a SystemConsumerStrategy
to a Text
understandable by the server.
strategyFromText :: Text -> Maybe SystemConsumerStrategy Source #
Tries to parse a SystemConsumerStrategy
given a raw Text
.
data PersistentSubscriptionSettings Source #
Gathers every persistent subscription property.
PersistentSubscriptionSettings | |
|
defaultPersistentSubscriptionSettings :: PersistentSubscriptionSettings Source #
System default persistent subscription settings.
msDuration :: Int64 -> Duration Source #
secsDuration :: Int64 -> Duration Source #