| Copyright | Copyright 2022 Shea Levy. |
|---|---|
| License | Apache-2.0 |
| Maintainer | shea@shealevy.com |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Observe.Event.Wai
Description
Synopsis
- application :: EventBackend IO r ServeRequest -> (r -> Application) -> Application
- data ServeRequest f where
- renderServeRequest :: RenderSelectorJSON ServeRequest
- data RequestField
- renderRequestField :: RenderFieldJSON RequestField
- onExceptionCallback :: EventBackend IO r OnException -> Maybe Request -> SomeException -> IO ()
- data OnException f where
- renderOnException :: Exception stex => RenderExJSON stex -> RenderSelectorJSON OnException
- data OnExceptionField = OnExceptionField (Maybe Request) SomeException
- renderOnExceptionField :: Exception stex => RenderExJSON stex -> RenderFieldJSON OnExceptionField
- renderRequest :: Request -> Value
Application
Arguments
| :: EventBackend IO r ServeRequest | |
| -> (r -> Application) | The application, called with a reference to the parent event. |
| -> Application |
Run an Application with generic Request/Response instrumentation.
Instrumentation
data ServeRequest f where Source #
Event selector for application.
Constructors
| ServeRequest :: ServeRequest RequestField |
renderServeRequest :: RenderSelectorJSON ServeRequest Source #
Render a ServeRequest, and any Events selected by it, to JSON
data RequestField Source #
A field for ServeRequest Events.
renderRequestField :: RenderFieldJSON RequestField Source #
Render a RequestField to JSON
setOnException
onExceptionCallback :: EventBackend IO r OnException -> Maybe Request -> SomeException -> IO () Source #
A setOnException callback which creates an Event rendering
Exceptions.
Ideally this would have a way to get a parent Event from application. Would be nice to
use vault, but there doesn't seem to be a way to get at the Request that Warp will pass
here.
Instrumentation
data OnException f where Source #
Selector for onException
Constructors
| OnException :: OnException OnExceptionField |
renderOnException :: Exception stex => RenderExJSON stex -> RenderSelectorJSON OnException Source #
Render an OnException, and its selected-for Events, as JSON, with a provided base structured exception type.
data OnExceptionField Source #
A field for a OnException Event.
Constructors
| OnExceptionField (Maybe Request) SomeException |
renderOnExceptionField :: Exception stex => RenderExJSON stex -> RenderFieldJSON OnExceptionField Source #
Render an OnExceptionField as JSON, with a provided base structured exception type.