Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Types and subroutines related to constructing transformations on HTTP requests.
Synopsis
- mkReqTransformCtx :: Text -> Maybe SessionVariables -> TemplatingEngine -> Request -> RequestTransformCtx
- runRequestTemplateTransform :: Template -> RequestTransformCtx -> Either TransformErrorBundle Value
- validateRequestTemplateTransform :: TemplatingEngine -> Template -> Either TransformErrorBundle ()
- validateRequestTemplateTransform' :: TemplatingEngine -> Template -> Validation TransformErrorBundle ()
- runUnescapedRequestTemplateTransform :: RequestTransformCtx -> UnescapedTemplate -> Either TransformErrorBundle ByteString
- runUnescapedRequestTemplateTransform' :: RequestTransformCtx -> UnescapedTemplate -> Validation TransformErrorBundle ByteString
- validateRequestUnescapedTemplateTransform :: TemplatingEngine -> UnescapedTemplate -> Either TransformErrorBundle ()
- validateRequestUnescapedTemplateTransform' :: TemplatingEngine -> UnescapedTemplate -> Validation TransformErrorBundle ()
Documentation
mkReqTransformCtx :: Text -> Maybe SessionVariables -> TemplatingEngine -> Request -> RequestTransformCtx Source #
A smart constructor for constructing the RequestTransformCtx
XXX: This function makes internal usage of decodeUtf8
, which throws an
impure exception when the supplied ByteString
cannot be decoded into valid
UTF8 text!
runRequestTemplateTransform :: Template -> RequestTransformCtx -> Either TransformErrorBundle Value Source #
A helper function for executing transformations from a Template
and a RequestTransformCtx
.
NOTE: This and all related funtions are hard-coded to Kriti at the
moment. When we add additional template engines this function will
need to take a TemplatingEngine
parameter.
validateRequestTemplateTransform :: TemplatingEngine -> Template -> Either TransformErrorBundle () Source #
validateRequestTemplateTransform' :: TemplatingEngine -> Template -> Validation TransformErrorBundle () Source #
runUnescapedRequestTemplateTransform :: RequestTransformCtx -> UnescapedTemplate -> Either TransformErrorBundle ByteString Source #
A helper function for executing Kriti transformations from a
UnescapedTemplate
and a RequestTrasformCtx
.
The difference from runRequestTemplateTransform
is that this
function will wrap the template text in double quotes before
running Kriti.
runUnescapedRequestTemplateTransform' :: RequestTransformCtx -> UnescapedTemplate -> Validation TransformErrorBundle ByteString Source #
Run a Kriti transformation with an unescaped template in
Validation
instead of Either
.