| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Web.Scotty.Internal.Types
Synopsis
- data Options = Options {}
- newtype RouteOptions = RouteOptions {
- maxRequestBodySize :: Maybe Kilobytes
- 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
- = Redirect Text
- | Next
- | Finish
- | ActionError Status 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 {}
- data RequestBodyState
- = BodyUntouched
- | BodyCached ByteString [ByteString]
- | BodyCorrupted
- data BodyPartiallyStreamed = BodyPartiallyStreamed
- data Content
- = ContentBuilder Builder
- | ContentFile FilePath
- | ContentStream StreamingBody
- 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
| |
newtype RouteOptions Source #
Constructors
| RouteOptions | |
Fields
| |
Instances
| Default RouteOptions Source # | |
Defined in Web.Scotty.Internal.Types Methods def :: RouteOptions | |
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 #
updateMaxRequestBodySize :: RouteOptions -> 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 Status 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 # | |
Defined in Web.Scotty.Internal.Types | |
| ScottyError e => ScottyError (ActionError e) Source # | |
Defined in Web.Scotty.Internal.Types | |
type ErrorHandler e m = Maybe (e -> ActionT e m ()) Source #
data ScottyException Source #
Constructors
| RequestException ByteString Status |
Instances
| Exception ScottyException Source # | |
Defined in Web.Scotty.Internal.Types Methods toException :: ScottyException -> SomeException fromException :: SomeException -> Maybe ScottyException displayException :: ScottyException -> String | |
| Show ScottyException Source # | |
Defined in Web.Scotty.Internal.Types Methods showsPrec :: Int -> ScottyException -> ShowS show :: ScottyException -> String showList :: [ScottyException] -> ShowS | |
data RequestBodyState Source #
Constructors
| BodyUntouched | |
| BodyCached ByteString [ByteString] | |
| BodyCorrupted |
data BodyPartiallyStreamed Source #
Constructors
| BodyPartiallyStreamed |
Instances
| Exception BodyPartiallyStreamed Source # | |
Defined in Web.Scotty.Internal.Types Methods toException :: BodyPartiallyStreamed -> SomeException fromException :: SomeException -> Maybe BodyPartiallyStreamed displayException :: BodyPartiallyStreamed -> String | |
| Show BodyPartiallyStreamed Source # | |
Defined in Web.Scotty.Internal.Types Methods showsPrec :: Int -> BodyPartiallyStreamed -> ShowS show :: BodyPartiallyStreamed -> String showList :: [BodyPartiallyStreamed] -> ShowS | |
Constructors
| ContentBuilder Builder | |
| ContentFile FilePath | |
| ContentStream StreamingBody |
data ScottyResponse Source #
Instances
| Default ScottyResponse Source # | |
Defined in Web.Scotty.Internal.Types Methods | |
newtype ActionT e m a Source #
Constructors
| ActionT | |
Fields
| |
Instances
| (ScottyError e, MonadBaseControl b m) => MonadBaseControl b (ActionT e m) Source # | |
Defined in Web.Scotty.Internal.Types Associated Types type StM (ActionT e m) a | |
| (MonadReader r m, ScottyError e) => MonadReader r (ActionT e m) Source # | |
| (MonadState s m, ScottyError e) => MonadState s (ActionT e m) Source # | |
| (MonadBase b m, ScottyError e) => MonadBase b (ActionT e m) Source # | |
Defined in Web.Scotty.Internal.Types | |
| ScottyError e => MonadTransControl (ActionT e) Source # | |
| ScottyError e => MonadTrans (ActionT 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 | |
| (Monad m, ScottyError e) => MonadFail (ActionT e m) Source # | |
Defined in Web.Scotty.Internal.Types | |
| (ScottyError e, MonadIO m) => MonadIO (ActionT e m) Source # | |
Defined in Web.Scotty.Internal.Types | |
| (Monad m, ScottyError e) => Alternative (ActionT e m) Source # | |
| Monad m => Applicative (ActionT e m) Source # | |
Defined in Web.Scotty.Internal.Types | |
| Functor m => Functor (ActionT e m) Source # | |
| (Monad m, ScottyError e) => Monad (ActionT e m) Source # | |
| (Monad m, ScottyError e) => MonadPlus (ActionT e m) Source # | |
| (MonadCatch m, ScottyError e) => MonadCatch (ActionT e m) Source # | |
Defined in Web.Scotty.Internal.Types | |
| (MonadThrow m, ScottyError e) => MonadThrow (ActionT e m) Source # | |
Defined in Web.Scotty.Internal.Types | |
| (Monad m, ScottyError e, Monoid a) => Monoid (ActionT e m a) Source # | |
| (Monad m, Semigroup a) => Semigroup (ActionT e m a) Source # | |
| type StT (ActionT e) a Source # | |
Defined in Web.Scotty.Internal.Types type StT (ActionT e) a = StT (StateT ScottyResponse) (StT (ReaderT ActionEnv) (StT (ExceptT (ActionError e)) a)) | |
| type StM (ActionT e m) a Source # | |
Defined in Web.Scotty.Internal.Types | |
data RoutePattern Source #
Instances
| IsString RoutePattern Source # | |
Defined in Web.Scotty.Internal.Types Methods fromString :: String -> RoutePattern | |