Copyright | Dennis Gosnell 2017 |
---|---|
License | BSD3 |
Maintainer | Dennis Gosnell (cdep.illabout@gmail.com) |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
This module exports functions and datatypes for using many different mime types.
Synopsis
- data MimeTypeInfo = MimeTypeInfo {}
- stringToBs :: String -> ByteString
- byteStringToExp :: ByteString -> Q Exp
- utf8ByteStringToExp :: ByteString -> Q Exp
- htmlToExp :: ByteString -> Q Exp
- extensionMimeTypeMap :: Map String MimeTypeInfo
- extensionToMimeTypeInfoEx :: FilePath -> Q MimeTypeInfo
- extensionToMimeTypeInfo :: FilePath -> Maybe MimeTypeInfo
- data CSS
- data GIF
- data JPEG
- data ICO
- data JS
- data PNG
- data SVG
- data TXT
- data EOT
- data TTF
- data WOFF
- data WOFF2
- data JSON
- data XML
- data GEXF
Documentation
data MimeTypeInfo Source #
Hold Type
s and functions work working with a given file type, like
html
or js
.
You can find examples of MimeTypeInfo
in the function
extensionMimeTypeMap
.
MimeTypeInfo | |
|
stringToBs :: String -> ByteString Source #
byteStringToExp :: ByteString -> Q Exp Source #
utf8ByteStringToExp :: ByteString -> Q Exp Source #
extensionMimeTypeMap :: Map String MimeTypeInfo Source #
A mapping from an extension like html
or js
to a MimeTypeInfo
for
that extension.
extensionToMimeTypeInfoEx :: FilePath -> Q MimeTypeInfo Source #
Just like extensionToMimeTypeInfo
, but throw an error using fail
if
the extension for the given FilePath
is not found.
extensionToMimeTypeInfo :: FilePath -> Maybe MimeTypeInfo Source #
Lookup the MimeTypeInfo
for a given FilePath
(that has an extension
like .html
or .js
). Returns Nothing
if the MimeTypeInfo
for the
given extension is not found.
Instances
Accept CSS Source # | text/css |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender CSS ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy CSS -> ByteString -> ByteString0 # |
Instances
Accept GIF Source # | image/gif |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender GIF ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy GIF -> ByteString -> ByteString0 # |
Instances
Accept JPEG Source # | image/jpeg |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender JPEG ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy JPEG -> ByteString -> ByteString0 # |
Since: 0.2.0.0
Instances
Accept ICO Source # | icon/ico |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender ICO ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy ICO -> ByteString -> ByteString0 # |
Instances
Accept JS Source # | application/javascript |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender JS ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy JS -> ByteString -> ByteString0 # |
Instances
Accept PNG Source # | image/png |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender PNG ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy PNG -> ByteString -> ByteString0 # |
Instances
Accept SVG Source # | image/svg |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender SVG ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy SVG -> ByteString -> ByteString0 # |
Instances
Accept TXT Source # | text/plain |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender TXT ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy TXT -> ByteString -> ByteString0 # |
Since: 0.2.0.0
Instances
Accept EOT Source # | fonts/eot |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender EOT ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy EOT -> ByteString -> ByteString0 # |
Since: 0.2.0.0
Instances
Accept TTF Source # | fonts/ttf |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender TTF ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy TTF -> ByteString -> ByteString0 # |
Since: 0.2.0.0
Instances
Accept WOFF Source # | fonts/woff |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender WOFF ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy WOFF -> ByteString -> ByteString0 # |
Since: 0.2.0.0
Instances
Accept WOFF2 Source # | fonts/woff2 |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender WOFF2 ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy WOFF2 -> ByteString -> ByteString0 # |
JSON file
Instances
Accept JSON Source # | application/json |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender JSON ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy JSON -> ByteString -> ByteString0 # |
XML file
Instances
Accept XML Source # | application/xml |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender XML ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy XML -> ByteString -> ByteString0 # |
GEXF file (xml for graph application)
Instances
Accept GEXF Source # | application/gexf |
Defined in Servant.Static.TH.Internal.Mime | |
MimeRender GEXF ByteString Source # | |
Defined in Servant.Static.TH.Internal.Mime mimeRender :: Proxy GEXF -> ByteString -> ByteString0 # |