minion-wai-extra-0.1.0.0: Minion wrappers for wai-extra
Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.Minion.Request.Multipart

Synopsis

Documentation

newtype Multipart backend a Source #

Constructors

Multipart a 

Instances

Instances details
IsRequest (Multipart backend a) Source # 
Instance details

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 # 
Instance details

Defined in Web.Minion.Request.Multipart

type RequestValue (Multipart backend a) = a

multipartBody Source #

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

Instances details
MonadIO m => Backend m Mem Source # 
Instance details

Defined in Web.Minion.Request.Multipart

Associated Types

type BackendFile Mem Source #

MonadResource m => Backend m Tmp Source # 
Instance details

Defined in Web.Minion.Request.Multipart

Associated Types

type BackendFile Tmp Source #

data Tmp Source #

Instances

Instances details
MonadResource m => Backend m Tmp Source # 
Instance details

Defined in Web.Minion.Request.Multipart

Associated Types

type BackendFile Tmp Source #

type BackendFile Tmp Source # 
Instance details

Defined in Web.Minion.Request.Multipart

data Mem Source #

Instances

Instances details
MonadIO m => Backend m Mem Source # 
Instance details

Defined in Web.Minion.Request.Multipart

Associated Types

type BackendFile Mem Source #

type BackendFile Mem Source # 
Instance details

Defined in Web.Minion.Request.Multipart

data MultipartData backend Source #

Constructors

MultipartData 

Fields

Instances

Instances details
FromMultipart (backend :: k) (MultipartData backend) Source # 
Instance details

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

Instances details
FromMultipart (backend :: k) (MultipartData backend) Source # 
Instance details

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 #

instance FromMultipart Tmp MyData where
  fromMultipart = do
    param1 <- getParam "param1"
    param2 <- getParam "param2"
    pure MyData {..}

lookupParam :: ByteString -> MultipartM backend (Maybe ByteString) Source #

instance FromMultipart Tmp MyData where
  fromMultipart = do
    param1 <- getParam "param1"
    param2 <- getParam "param2"
    pure MyData {..}

getFile :: ByteString -> MultipartM backend (FileInfo (BackendFile backend)) Source #

instance FromMultipart Tmp MyData where
  fromMultipart = do
    file1 <- getFile "file1"
    file2 <- getFile "file2"
    pure MyData {..}

lookupFile :: ByteString -> MultipartM backend (Maybe (FileInfo (BackendFile backend))) Source #

instance FromMultipart Tmp MyData where
  fromMultipart = 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.