| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Web.Scotty.Internal.Types
Synopsis
- data Options = Options {}
- type Middleware m = Application m -> Application m
- type Application m = Request -> m Response
- data ScottyState e m = ScottyState {
- middlewares :: [Middleware]
- routes :: [Middleware m]
- handler :: ErrorHandler e m
- addMiddleware :: Middleware -> ScottyState e m -> ScottyState e m
- addRoute :: Middleware m -> ScottyState e m -> ScottyState e m
- addHandler :: ErrorHandler e m -> ScottyState e m -> ScottyState e m
- newtype ScottyT e m a = ScottyT {
- runS :: State (ScottyState e m) a
- data ActionError e
- = Redirect Text
- | Next
- | Finish
- | ActionError e
- class ScottyError e where
- stringError :: String -> e
- showError :: e -> Text
- type ErrorHandler e m = Maybe (e -> ActionT e m ())
- type Param = (Text, Text)
- type File = (Text, FileInfo ByteString)
- data ActionEnv = Env {
- getReq :: Request
- getParams :: [Param]
- getBody :: IO ByteString
- getBodyChunk :: IO ByteString
- getFiles :: [File]
- data RequestBodyState
- data BodyPartiallyStreamed = BodyPartiallyStreamed
- data Content
- data ScottyResponse = SR {}
- newtype ActionT e m a = ActionT {
- runAM :: ExceptT (ActionError e) (ReaderT ActionEnv (StateT ScottyResponse m)) a
- data RoutePattern
Documentation
Constructors
| Options | |
Fields
| |
type Middleware m = Application m -> Application m Source #
type Application m = Request -> m Response Source #
data ScottyState e m Source #
Constructors
| ScottyState | |
Fields
| |
Instances
| Default (ScottyState e m) Source # | |
Defined in Web.Scotty.Internal.Types Methods def :: ScottyState e m # | |
addMiddleware :: Middleware -> ScottyState e m -> ScottyState e m Source #
addRoute :: Middleware m -> ScottyState e m -> ScottyState e m Source #
addHandler :: ErrorHandler e m -> ScottyState e m -> ScottyState e m Source #
newtype ScottyT e m a Source #
Constructors
| ScottyT | |
Fields
| |
data ActionError e Source #
Constructors
| Redirect Text | |
| Next | |
| Finish | |
| ActionError e |
Instances
| ScottyError e => ScottyError (ActionError e) Source # | |
Defined in Web.Scotty.Internal.Types | |
| (ScottyError e, Monad m) => MonadError (ActionError e) (ActionT e m) Source # | |
Defined in Web.Scotty.Internal.Types Methods throwError :: ActionError e -> ActionT e m a # catchError :: ActionT e m a -> (ActionError e -> ActionT e m a) -> ActionT e m a # | |
class ScottyError e where Source #
In order to use a custom exception type (aside from Text), you must
define an instance of ScottyError for that type.
Instances
| ScottyError Text Source # | |
| ScottyError e => ScottyError (ActionError e) Source # | |
Defined in Web.Scotty.Internal.Types | |
type ErrorHandler e m = Maybe (e -> ActionT e m ()) Source #
Constructors
| Env | |
Fields
| |
data RequestBodyState Source #
Constructors
| BodyUntouched | |
| BodyCached ByteString [ByteString] | |
| BodyCorrupted |
data BodyPartiallyStreamed Source #
Constructors
| BodyPartiallyStreamed |
Instances
| Show BodyPartiallyStreamed Source # | |
Defined in Web.Scotty.Internal.Types Methods showsPrec :: Int -> BodyPartiallyStreamed -> ShowS # show :: BodyPartiallyStreamed -> String # showList :: [BodyPartiallyStreamed] -> ShowS # | |
| Exception BodyPartiallyStreamed Source # | |
Defined in Web.Scotty.Internal.Types | |
Constructors
| ContentBuilder Builder | |
| ContentFile FilePath | |
| ContentStream StreamingBody |
data ScottyResponse Source #
Instances
| Default ScottyResponse Source # | |
Defined in Web.Scotty.Internal.Types Methods def :: ScottyResponse # | |
newtype ActionT e m a Source #
Constructors
| ActionT | |
Fields
| |
Instances
data RoutePattern Source #
Instances
| IsString RoutePattern Source # | |
Defined in Web.Scotty.Internal.Types Methods fromString :: String -> RoutePattern # | |