Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype WhebT g s m a = WhebT {
- runWhebT :: ExceptT WhebError (ReaderT (HandlerData g s m) (StateT (InternalState s) m)) a
- newtype InitM g s m a = InitM {
- runInitM :: WriterT (InitOptions g s m) IO a
- class WhebContent a where
- toResponse :: Status -> ResponseHeaders -> a -> Response
- data WhebFile = WhebFile Text
- data HandlerResponse = forall a . WhebContent a => HandlerResponse Status a
- data HandlerData g s m = HandlerData {
- globalCtx :: g
- request :: Request
- postData :: ([Param], [File ByteString])
- routeParams :: RouteParamList
- globalSettings :: WhebOptions g s m
- data InternalState s = InternalState {
- reqState :: s
- respHeaders :: Map HeaderName ByteString
- data SettingsValue = forall a . Typeable a => MkVal a
- data WhebError
- data InitOptions g s m = InitOptions {
- initRoutes :: [Route g s m]
- initWhebSockets :: [SocketRoute g s m]
- initSites :: [PackedSite g s m]
- initSettings :: CSettings
- initWaiMw :: Middleware
- initWhebMw :: [WhebMiddleware g s m]
- initCleanup :: [IO ()]
- data WhebOptions g s m = MonadIO m => WhebOptions {
- appRoutes :: [Route g s m]
- appWhebSockets :: [SocketRoute g s m]
- appSites :: [PackedSite g s m]
- runTimeSettings :: CSettings
- warpSettings :: Settings
- startingCtx :: g
- startingState :: InternalState s
- waiStack :: Middleware
- whebMiddlewares :: [WhebMiddleware g s m]
- defaultErrorHandler :: WhebError -> WhebHandlerT g s m
- shutdownTVar :: TVar Bool
- activeConnections :: TVar Int
- cleanupActions :: [IO ()]
- type EResponse = Either WhebError Response
- type CSettings = Map Text SettingsValue
- type WhebHandler g s = WhebT g s IO HandlerResponse
- type WhebHandlerT g s m = WhebT g s m HandlerResponse
- type WhebMiddleware g s m = WhebT g s m (Maybe HandlerResponse)
- type WhebSocket g s m = Connection -> WhebT g s m ()
- type MinWheb a = WhebT () () IO a
- type MinHandler = MinWheb HandlerResponse
- type MinOpts = WhebOptions () () IO
- data PackedSite g s m = forall a . PackedSite Text (Site a (WhebHandlerT g s m))
- type RouteParamList = [(Text, ParsedChunk)]
- type MethodMatch = StdMethod -> Bool
- data ParsedChunk = forall a . (Typeable a, Show a) => MkChunk a
- data UrlBuildError
- data UrlParser = UrlParser {
- parseFunc :: [Text] -> Maybe RouteParamList
- genFunc :: RouteParamList -> Either UrlBuildError Text
- data Route g s m = Route {
- routeName :: Maybe Text
- routeMethod :: MethodMatch
- routeParser :: UrlParser
- routeHandler :: WhebHandlerT g s m
- data SocketRoute g s m = SocketRoute {
- srouteParser :: UrlParser
- srouteHandler :: WhebSocket g s m
- data ChunkType
- data UrlPat
Documentation
WhebT g s m
- g -> The global confirgured context (Read-only data shared between threads)
- s -> Handler state for each request.
- m -> Monad we are transforming
WhebT | |
|
Writer Monad to build options.
InitM | |
|
class WhebContent a where Source
Converts a type to a WAI Response
toResponse :: Status -> ResponseHeaders -> a -> Response Source
data HandlerResponse Source
forall a . WhebContent a => HandlerResponse Status a |
data HandlerData g s m Source
HandlerData | |
|
data InternalState s Source
data SettingsValue Source
data InitOptions g s m Source
Monoid to use in InitM's WriterT
InitOptions | |
|
Monoid (InitOptions g s m) |
data WhebOptions g s m Source
The main option datatype for Wheb
MonadIO m => WhebOptions | |
|
type CSettings = Map Text SettingsValue Source
type WhebHandler g s = WhebT g s IO HandlerResponse Source
type WhebHandlerT g s m = WhebT g s m HandlerResponse Source
type WhebMiddleware g s m = WhebT g s m (Maybe HandlerResponse) Source
type WhebSocket g s m = Connection -> WhebT g s m () Source
type MinHandler = MinWheb HandlerResponse Source
type MinOpts = WhebOptions () () IO Source
A minimal type for WhebOptions
Routes
data PackedSite g s m Source
forall a . PackedSite Text (Site a (WhebHandlerT g s m)) |
type RouteParamList = [(Text, ParsedChunk)] Source
type MethodMatch = StdMethod -> Bool Source
A Parser should be able to extract params and regenerate URL from params.
UrlParser | |
|
Route | |
|
data SocketRoute g s m Source
SocketRoute | |
|