Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Multipart backend a = Multipart a
- multipartBody :: forall backend r m i ts. Introspection i Request (Multipart backend r) => MonadThrow m => FromMultipart backend r => Backend m backend => ValueCombinator i (WithReq m (Multipart backend r)) ts m
- class MonadIO m => Backend m backend where
- type BackendFile backend :: Type
- waiBackend :: m (BackEnd (BackendFile backend))
- data Tmp
- data Mem
- data MultipartData backend = MultipartData {
- params :: [Param]
- files :: [File (BackendFile backend)]
- class FromMultipart backend a where
- fromMultipart :: MultipartM backend a
- type MultipartM backend = ReaderT (MultipartData backend) (Except Text)
- getParam :: ByteString -> MultipartM backend ByteString
- lookupParam :: ByteString -> MultipartM backend (Maybe ByteString)
- getFile :: ByteString -> MultipartM backend (FileInfo (BackendFile backend))
- lookupFile :: ByteString -> MultipartM backend (Maybe (FileInfo (BackendFile backend)))
- type File y = (ByteString, FileInfo y)
- type Param = (ByteString, ByteString)
Documentation
newtype Multipart backend a Source #
Instances
IsRequest (Multipart backend a) Source # | |
Defined in Web.Minion.Request.Multipart type RequestValue (Multipart backend a) # getRequestValue :: Multipart backend a -> RequestValue (Multipart backend a) # | |
type RequestValue (Multipart backend a) Source # | |
Defined in Web.Minion.Request.Multipart |
:: forall backend r m i ts. Introspection i Request (Multipart backend r) | |
=> MonadThrow m | |
=> FromMultipart backend r | |
=> Backend m backend | |
=> ValueCombinator i (WithReq m (Multipart backend r)) ts m | . |
Extracts multipart data from request body
... />multipartBody
@Tmp
@Foo .> ...
class MonadIO m => Backend m backend where Source #
type BackendFile backend :: Type Source #
waiBackend :: m (BackEnd (BackendFile backend)) Source #
Instances
MonadIO m => Backend m Mem Source # | |
Defined in Web.Minion.Request.Multipart type BackendFile Mem Source # waiBackend :: m (BackEnd (BackendFile Mem)) Source # | |
MonadResource m => Backend m Tmp Source # | |
Defined in Web.Minion.Request.Multipart type BackendFile Tmp Source # waiBackend :: m (BackEnd (BackendFile Tmp)) Source # |
Instances
MonadResource m => Backend m Tmp Source # | |
Defined in Web.Minion.Request.Multipart type BackendFile Tmp Source # waiBackend :: m (BackEnd (BackendFile Tmp)) Source # | |
type BackendFile Tmp Source # | |
Defined in Web.Minion.Request.Multipart |
Instances
MonadIO m => Backend m Mem Source # | |
Defined in Web.Minion.Request.Multipart type BackendFile Mem Source # waiBackend :: m (BackEnd (BackendFile Mem)) Source # | |
type BackendFile Mem Source # | |
Defined in Web.Minion.Request.Multipart |
data MultipartData backend Source #
MultipartData | |
|
Instances
FromMultipart (backend :: k) (MultipartData backend) Source # | |
Defined in Web.Minion.Request.Multipart fromMultipart :: MultipartM backend (MultipartData backend) Source # |
class FromMultipart backend a where Source #
fromMultipart :: MultipartM backend a Source #
Instances
FromMultipart (backend :: k) (MultipartData backend) Source # | |
Defined in Web.Minion.Request.Multipart fromMultipart :: MultipartM backend (MultipartData backend) Source # |
type MultipartM backend = ReaderT (MultipartData backend) (Except Text) Source #
getParam :: ByteString -> MultipartM backend ByteString Source #
instanceFromMultipart
Tmp
MyData wherefromMultipart
= do param1 <-getParam
"param1" param2 <-getParam
"param2" pure MyData {..}
lookupParam :: ByteString -> MultipartM backend (Maybe ByteString) Source #
instanceFromMultipart
Tmp
MyData wherefromMultipart
= do param1 <-getParam
"param1" param2 <-getParam
"param2" pure MyData {..}
getFile :: ByteString -> MultipartM backend (FileInfo (BackendFile backend)) Source #
instanceFromMultipart
Tmp
MyData wherefromMultipart
= do file1 <-getFile
"file1" file2 <-getFile
"file2" pure MyData {..}
lookupFile :: ByteString -> MultipartM backend (Maybe (FileInfo (BackendFile backend))) Source #
instanceFromMultipart
Tmp
MyData wherefromMultipart
= do file1 <-lookupFile
"file1" file2 <-lookupFile
"file2" pure MyData {..}
type File y = (ByteString, FileInfo y) #
Post parameter name and associated file information.
type Param = (ByteString, ByteString) #
Post parameter name and value.