eventuo11y-batteries-0.4.0.0: Grab bag of eventuo11y-enriched functionality
CopyrightCopyright 2022 Shea Levy.
LicenseApache-2.0
Maintainershea@shealevy.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Observe.Event.Servant.Client

Description

This module offers a variant of servant-client's ClientM which instruments all requests with Events. It also has miscellaneous helpers for instrumenting servant-client functionality in other ways.

Synopsis

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.

data ClientEnv s Source #

An instrumented ClientEnv

Instances

Instances details
(MonadIO (em r s), MonadWithEvent em) => RunClient (ClientM em s r s) Source # 
Instance details

Defined in Observe.Event.Servant.Client

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

data RunRequestField Source #

A field for RunRequest events.

Miscellaneous instrumentation

clientErrorJSON :: RenderFieldJSON ClientError Source #

Render a ClientError, considered as an Event field, as JSON

responseJSON :: Response -> Bool -> Value Source #

Render a Response as JSON, optionally forcing rendering the body even if it's large.