Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Options = Options {}
- newtype RouteOptions = RouteOptions {}
- type Kilobytes = Int
- 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
- routeOptions :: RouteOptions
- 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
- updateMaxRequestBodySize :: RouteOptions -> ScottyState e m -> ScottyState e m
- newtype ScottyT e m a = ScottyT {
- runS :: State (ScottyState e m) a
- data ActionError e
- class ScottyError e where
- stringError :: String -> e
- showError :: e -> Text
- type ErrorHandler e m = Maybe (e -> ActionT e m ())
- data ScottyException = RequestException ByteString Status
- 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
Options | |
|
newtype RouteOptions Source #
Instances
Default RouteOptions Source # | |
Defined in Web.Scotty.Internal.Types def :: RouteOptions # |
type Middleware m = Application m -> Application m Source #
type Application m = Request -> m Response Source #
data ScottyState e m Source #
ScottyState | |
|
Instances
Default (ScottyState e m) Source # | |
Defined in Web.Scotty.Internal.Types 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 #
updateMaxRequestBodySize :: RouteOptions -> ScottyState e m -> ScottyState e m Source #
newtype ScottyT e m a Source #
ScottyT | |
|
data ActionError e Source #
Instances
ScottyError e => ScottyError (ActionError e) Source # | |
Defined in Web.Scotty.Internal.Types stringError :: String -> ActionError e Source # showError :: ActionError e -> Text Source # | |
(ScottyError e, Monad m) => MonadError (ActionError e) (ActionT e m) Source # | |
Defined in Web.Scotty.Internal.Types 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 stringError :: String -> ActionError e Source # showError :: ActionError e -> Text Source # |
type ErrorHandler e m = Maybe (e -> ActionT e m ()) Source #
data ScottyException Source #
Instances
Exception ScottyException Source # | |
Defined in Web.Scotty.Internal.Types | |
Show ScottyException Source # | |
Defined in Web.Scotty.Internal.Types showsPrec :: Int -> ScottyException -> ShowS # show :: ScottyException -> String # showList :: [ScottyException] -> ShowS # |
Env | |
|
data BodyPartiallyStreamed Source #
Instances
Exception BodyPartiallyStreamed Source # | |
Show BodyPartiallyStreamed Source # | |
Defined in Web.Scotty.Internal.Types showsPrec :: Int -> BodyPartiallyStreamed -> ShowS # show :: BodyPartiallyStreamed -> String # showList :: [BodyPartiallyStreamed] -> ShowS # |
data ScottyResponse Source #
Instances
Default ScottyResponse Source # | |
Defined in Web.Scotty.Internal.Types def :: ScottyResponse # |
newtype ActionT e m a Source #
ActionT | |
|
Instances
data RoutePattern Source #
Instances
IsString RoutePattern Source # | |
Defined in Web.Scotty.Internal.Types fromString :: String -> RoutePattern # |