Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- runPgLocals :: AppConfig -> HashMap Text Value -> (ApiRequest -> ExceptT Error Transaction Response) -> ApiRequest -> ByteString -> ExceptT Error Transaction Response
- pgrstFormat :: Status -> OutputFormatter
- pgrstMiddleware :: LogLevel -> Application -> Application
- defaultCorsPolicy :: CorsResourcePolicy
- corsPolicy :: Request -> Maybe CorsResourcePolicy
- optionalRollback :: AppConfig -> ApiRequest -> ExceptT Error Transaction Response -> ExceptT Error Transaction Response
Documentation
runPgLocals :: AppConfig -> HashMap Text Value -> (ApiRequest -> ExceptT Error Transaction Response) -> ApiRequest -> ByteString -> ExceptT Error Transaction Response Source #
Runs local(transaction scoped) GUCs for every request, plus the pre-request function
pgrstFormat :: Status -> OutputFormatter Source #
Log in apache format. Only requests that have a status greater than minStatus are logged. | There's no way to filter logs in the apache format on wai-extra: https://hackage.haskell.org/package/wai-extra-3.0.29.2/docs/Network-Wai-Middleware-RequestLogger.html#t:OutputFormat. | So here we copy wai-logger apacheLogStr function: https://github.com/kazu-yamamoto/logger/blob/a4f51b909a099c51af7a3f75cf16e19a06f9e257/wai-logger/Network/Wai/Logger/Apache.hs#L45 | TODO: Add the ability to filter apache logs on wai-extra and remove this function.
pgrstMiddleware :: LogLevel -> Application -> Application Source #
corsPolicy :: Request -> Maybe CorsResourcePolicy Source #
CORS policy to be used in by Wai Cors middleware
optionalRollback :: AppConfig -> ApiRequest -> ExceptT Error Transaction Response -> ExceptT Error Transaction Response Source #
Set a transaction to eventually roll back if requested and set respective headers on the response.