Copyright | Copyright 2022 Shea Levy. |
---|---|
License | Apache-2.0 |
Maintainer | shea@shealevy.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- type ClientM em s = TransEventMonad (ReaderT (ClientEnv s)) (TransEventMonad (ExceptT ClientError) em)
- data ClientEnv s = ClientEnv {
- env :: !ClientEnv
- injectRunRequest :: !(InjectSelector RunRequest s)
- runClientM :: ClientM em s r s' a -> ClientEnv s -> em r s' (Either ClientError a)
- data RunRequest f where
- runRequestJSON :: RenderSelectorJSON RunRequest
- data RunRequestField
- runRequestFieldJSON :: RenderFieldJSON RunRequestField
- clientErrorJSON :: RenderFieldJSON ClientError
- responseJSON :: Response -> Bool -> Value
ClientM
type ClientM em s = TransEventMonad (ReaderT (ClientEnv s)) (TransEventMonad (ExceptT ClientError) em) Source #
A monad to use in place of ClientM
to get instrumentation on requests.
Note that ClientM
is only RunClient
when the selector of the ambient EventBackend
is
s
, see the instance under ClientEnv
.
An instrumented ClientEnv
ClientEnv | |
|
Instances
(MonadIO (em r s), MonadWithEvent em) => RunClient (ClientM em s r s) Source # | |
Defined in Observe.Event.Servant.Client runRequestAcceptStatus :: Maybe [Status] -> Request -> ClientM em s r s Response # throwClientError :: ClientError -> ClientM em s r s a # |
runClientM :: ClientM em s r s' a -> ClientEnv s -> em r s' (Either ClientError a) Source #
Instrumented version of runClientM
Instrumentation
data RunRequest f where Source #
Selector for events in ClientM
runRequestJSON :: RenderSelectorJSON RunRequest Source #
Render a RunRequest
and the fields of its selected events as JSON
runRequestFieldJSON :: RenderFieldJSON RunRequestField Source #
Render a RunRequestField
as JSON.
Miscellaneous instrumentation
clientErrorJSON :: RenderFieldJSON ClientError Source #
Render a ClientError
, considered as an Event
field, as JSON