http-env-0.0.0.0: src/Network/HTTP/Env/Servant.hs
-- | Call an HTTP dependency with servant-client, through the same env as
-- "Network.HTTP.Env", which this module re-exports.
--
-- = Usage
--
-- Make the t'HttpEnv' as in "Network.HTTP.Env", then a t'ClientEnv' that
-- shares its layers, so that servant calls and plain calls to one
-- dependency share one breaker and one budget:
--
-- > clientEnv = servantClientEnv httpEnv baseUrl (const LevelError)
-- >
-- > result <- callClient clientEnv someClientM
-- > case result of
-- > Right a -> ...
-- > Left HttpEnvErrorCircuitOpen -> ...
-- > Left (HttpEnvErrorRateLimited wait _) -> ...
-- > Left (HttpEnvErrorFailed clientError) -> ...
module Network.HTTP.Env.Servant
( -- * Servant
ClientEnv,
servantClientEnv,
callClient,
callClientWith,
callStreamingClient,
callStreamingClientWith,
peekClientEnv,
-- * Everything in "Network.HTTP.Env"
module Network.HTTP.Env,
)
where
import Network.HTTP.Env
import Network.HTTP.Env.Servant.Client (ClientEnv, callClient, callClientWith, callStreamingClient, callStreamingClientWith, peekClientEnv, servantClientEnv)