Copyright | Copyright 2022 Shea Levy. |
---|---|
License | Apache-2.0 |
Maintainer | shea@shealevy.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- type ClientM em r s = TransEventMonad (ReaderT (ClientEnv s)) (TransEventMonad (ExceptT ClientError) em) r s
- data ClientEnv s = ClientEnv {
- env :: !ClientEnv
- injectRunRequest :: !(InjectSelector RunRequest s)
- runClientM :: ClientM em 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 r s = TransEventMonad (ReaderT (ClientEnv s)) (TransEventMonad (ExceptT ClientError) em) r s Source #
A monad to use in place of ClientM
to get instrumentation on requests.
An instrumented ClientEnv
ClientEnv | |
|
Instances
(MonadIO (em r s), MonadWithEvent em r s) => RunClient (ClientM em r s) Source # | |
Defined in Observe.Event.Servant.Client runRequestAcceptStatus :: Maybe [Status] -> Request -> ClientM em r s Response # throwClientError :: ClientError -> ClientM em r s a # |
runClientM :: ClientM em 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