Safe Haskell | None |
---|---|
Language | Haskell2010 |
A simple URL templating that enables interpolating environment variables
Synopsis
- newtype Variable = Variable {
- unVariable :: Text
- printVariable :: Variable -> Text
- data TemplateItem
- = TIText !Text
- | TIVariable !Variable
- printTemplateItem :: TemplateItem -> Text
- newtype URLTemplate = URLTemplate {}
- printURLTemplate :: URLTemplate -> Text
- mkPlainURLTemplate :: Text -> URLTemplate
- parseURLTemplate :: Text -> Either String URLTemplate
- renderURLTemplate :: Environment -> URLTemplate -> Either String Text
Documentation
Variable | |
|
Instances
printVariable :: Variable -> Text Source #
data TemplateItem Source #
TIText !Text | |
TIVariable !Variable |
Instances
printTemplateItem :: TemplateItem -> Text Source #
newtype URLTemplate Source #
A String with environment variables enclosed in '{{' and '}}' http://{{APP_HOST}}:{{APP_PORT}}/v1/api
Instances
printURLTemplate :: URLTemplate -> Text Source #
mkPlainURLTemplate :: Text -> URLTemplate Source #
parseURLTemplate :: Text -> Either String URLTemplate Source #
renderURLTemplate :: Environment -> URLTemplate -> Either String Text Source #