eventuo11y-batteries-0.3.0.2: 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 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.

data ClientEnv s Source #

An instrumented ClientEnv

Instances

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

Defined in Observe.Event.Servant.Client

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

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.