-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Hack contrib -- -- Hack contrib @package hack-contrib @version 2009.7.3 module Hack.Contrib.Mime lookup_mime_type :: String -> Maybe String mime_types :: Map String String -- | print the env and response in the console module Hack.Contrib.Middleware.Inspect inspect :: Middleware module Hack.Contrib.Middleware.Hub data Severity Debug :: Severity Info :: Severity Warn :: Severity Error :: Severity Fatal :: Severity Unknown :: Severity hint :: Severity -> String type Formatter = Severity -> UTCTime -> Int -> String -> String -> String type Logger = String -> Severity -> IO () hub :: (String -> IO ()) -> Formatter -> String -> Logger get_pid :: IO Int simple_logger :: (String -> IO ()) -> String -> Logger simple_formatter :: Formatter colorize :: Severity -> String -> String instance Show Severity instance Eq Severity -- | print the env and response in the console module Hack.Contrib.Middleware.Debug debug :: (Env -> Response -> IO ()) -> Middleware -- | Stolen from rack-contrib: modifies the environment using the block -- given during initialization. module Hack.Contrib.Middleware.Config config :: (Env -> Env) -> Middleware module Hack.Contrib.Middleware.Censor censor :: (Response -> IO Response) -> Middleware module Hack.Contrib.Constants status_with_no_entity_body :: [Int] _CacheControl :: String _Connection :: String _Date :: String _Pragma :: String _TransferEncoding :: String _Upgrade :: String _Via :: String _Accept :: String _AcceptCharset :: String _AcceptEncoding :: String _AcceptLanguage :: String _Authorization :: String _Cookie :: String _Expect :: String _From :: String _Host :: String _IfModifiedSince :: String _IfMatch :: String _IfNoneMatch :: String _IfRange :: String _IfUnmodifiedSince :: String _MaxForwards :: String _ProxyAuthorization :: String _Range :: String _Referer :: String _UserAgent :: String _Age :: String _Location :: String _ProxyAuthenticate :: String _Public :: String _RetryAfter :: String _Server :: String _SetCookie :: String _TE :: String _Trailer :: String _Vary :: String _Warning :: String _WWWAuthenticate :: String _Allow :: String _ContentBase :: String _ContentEncoding :: String _ContentLanguage :: String _ContentLength :: String _ContentLocation :: String _ContentMD5 :: String _ContentRange :: String _ContentType :: String _ETag :: String _Expires :: String _LastModified :: String _ContentTransferEncoding :: String _TextPlain :: String _TextHtml :: String _TextPlainUTF8 :: String _TextHtmlUTF8 :: String status_code :: Map Int String module Hack.Contrib.Utils empty_app :: Application -- | usage: app.use [content_type, cache] use :: [Middleware] -> Middleware put :: String -> String -> [(String, String)] -> [(String, String)] get :: String -> [(String, String)] -> Maybe String bytesize :: ByteString -> Int dummy_middleware :: Middleware dummy_app :: Application escape_html :: String -> String escape_uri :: String -> String unescape_uri :: String -> String show_status_message :: Int -> Maybe String now :: IO UTCTime httpdate :: UTCTime -> String format_time :: String -> UTCTime -> String request_method :: Env -> RequestMethod script_name :: Env -> String path_info :: Env -> String query_string :: Env -> String server_name :: Env -> String server_port :: Env -> Int hack_version :: Env -> [Int] hack_url_scheme :: Env -> Hack_UrlScheme hack_input :: Env -> ByteString hack_errors :: Env -> HackErrors custom :: Env -> [(String, String)] -- | matching a list of regexp agains a path_info, if matched, consponding -- app is used, otherwise, pass the env down to lower middleware module Hack.Contrib.Middleware.RegexpRouter regexp_router :: [RoutePath] -> Middleware -- | Stolen from rack: catches all exceptions raised from the app it wraps. module Hack.Contrib.Middleware.ShowExceptions show_exceptions :: Maybe (String -> IO ()) -> Middleware -- | Stolen from rack: Rack::URLMap takes a hash mapping urls or paths to -- apps, and dispatches accordingly. -- -- URLMap modifies the SCRIPT_NAME and PATH_INFO such that the part -- relevant for dispatch is in the SCRIPT_NAME, and the rest in the -- PATH_INFO. This should be taken care of when you need to reconstruct -- the URL in order to create links. -- -- URLMap dispatches in such a way that the longest paths are tried -- first, since they are most specific. module Hack.Contrib.Middleware.URLMap url_map :: [RoutePath] -> Middleware module Hack.Contrib.Request body :: Env -> ByteString scheme :: Env -> String port :: Env -> Int path :: Env -> String content_type :: Env -> String media_type :: Env -> String media_type_params :: Env -> [(String, String)] content_charset :: Env -> String host :: Env -> String params :: Env -> [(String, String)] inputs :: Env -> [(String, String)] referer :: Env -> String cookies :: Env -> [(String, String)] fullpath :: Env -> String set_http :: String -> String -> Env -> Env set_custom :: String -> String -> Env -> Env url :: Env -> String module Hack.Contrib.Middleware.SimpleAccessLogger simple_access_logger :: Maybe (String -> IO ()) -> Middleware module Hack.Contrib.Response redirect :: String -> Maybe Int -> Response -> Response finish :: Response -> Response header :: String -> Response -> Maybe String has_header :: String -> Response -> Bool set_header :: String -> String -> Response -> Response delete_header :: String -> Response -> Response set_content_type :: String -> Response -> Response set_content_length :: Int -> Response -> Response set_body :: ByteString -> Response -> Response set_status :: Int -> Response -> Response set_last_modified :: String -> Response -> Response -- | Stolen from rack: Sets the Content-Length header on responses with -- fixed-length bodies. module Hack.Contrib.Middleware.ContentLength content_length :: Middleware -- | Stolen from rack: Sets the Content-Type header on responses which -- don't have one. module Hack.Contrib.Middleware.ContentType content_type :: String -> Middleware -- | Stolen from rack-contrib: Automatically sets the ETag header on all -- String bodies module Hack.Contrib.Middleware.ETag etag :: Middleware -- | Stolen from rack: serves files below the +root+ given, according to -- the path info of the Rack request. module Hack.Contrib.Middleware.File file :: Maybe String -> Middleware -- | Stolen from rack: The Rack::Static middleware intercepts requests for -- static files (javascript files, images, stylesheets, etc) based on the -- url prefixes passed in the options, and serves them using a Rack::File -- object. This allows a Rack stack to serve both static and dynamic -- content. module Hack.Contrib.Middleware.Static static :: Maybe String -> [String] -> Middleware module Hack.Contrib.Middleware.Head head :: Middleware -- | Paste has a Pony, Rack has a Lobster, Hack has a Lambda >< module Hack.Contrib.Middleware.Lambda lambda :: Middleware -- | Paste has a Pony, Rack has a Lobster, Hack has a Lucky - - module Hack.Contrib.Middleware.Lucky lucky :: Middleware module Hack.Contrib.Middleware.NotFound not_found :: Middleware -- | Stolen from rack-contrib: Bounce those annoying favicon.ico requests module Hack.Contrib.Middleware.BounceFavicon bounce_favicon :: Middleware