| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Web.Minion.Request.Multipart
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 #
Constructors
| Multipart a |
Instances
| IsRequest (Multipart backend a) Source # | |
Defined in Web.Minion.Request.Multipart Associated Types type RequestValue (Multipart backend a) # Methods getRequestValue :: Multipart backend a -> RequestValue (Multipart backend a) # | |
| type RequestValue (Multipart backend a) Source # | |
Defined in Web.Minion.Request.Multipart | |
Arguments
| :: 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 #
Associated Types
type BackendFile backend :: Type Source #
Methods
waiBackend :: m (BackEnd (BackendFile backend)) Source #
Instances
| MonadIO m => Backend m Mem Source # | |
Defined in Web.Minion.Request.Multipart Associated Types type BackendFile Mem Source # Methods waiBackend :: m (BackEnd (BackendFile Mem)) Source # | |
| MonadResource m => Backend m Tmp Source # | |
Defined in Web.Minion.Request.Multipart Associated Types type BackendFile Tmp Source # Methods waiBackend :: m (BackEnd (BackendFile Tmp)) Source # | |
Instances
| MonadResource m => Backend m Tmp Source # | |
Defined in Web.Minion.Request.Multipart Associated Types type BackendFile Tmp Source # Methods 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 Associated Types type BackendFile Mem Source # Methods waiBackend :: m (BackEnd (BackendFile Mem)) Source # | |
| type BackendFile Mem Source # | |
Defined in Web.Minion.Request.Multipart | |
data MultipartData backend Source #
Constructors
| MultipartData | |
Fields
| |
Instances
| FromMultipart (backend :: k) (MultipartData backend) Source # | |
Defined in Web.Minion.Request.Multipart Methods fromMultipart :: MultipartM backend (MultipartData backend) Source # | |
class FromMultipart backend a where Source #
Methods
fromMultipart :: MultipartM backend a Source #
Instances
| FromMultipart (backend :: k) (MultipartData backend) Source # | |
Defined in Web.Minion.Request.Multipart Methods fromMultipart :: MultipartM backend (MultipartData backend) Source # | |
type MultipartM backend = ReaderT (MultipartData backend) (Except Text) Source #
getParam :: ByteString -> MultipartM backend ByteString Source #
instanceFromMultipartTmpMyData wherefromMultipart= do param1 <-getParam"param1" param2 <-getParam"param2" pure MyData {..}
lookupParam :: ByteString -> MultipartM backend (Maybe ByteString) Source #
instanceFromMultipartTmpMyData wherefromMultipart= do param1 <-getParam"param1" param2 <-getParam"param2" pure MyData {..}
getFile :: ByteString -> MultipartM backend (FileInfo (BackendFile backend)) Source #
instanceFromMultipartTmpMyData wherefromMultipart= do file1 <-getFile"file1" file2 <-getFile"file2" pure MyData {..}
lookupFile :: ByteString -> MultipartM backend (Maybe (FileInfo (BackendFile backend))) Source #
instanceFromMultipartTmpMyData 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.