From: PHO Date: Wed, 30 Nov 2011 14:00:27 +0000 (+0900) Subject: docs X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=060378a;p=Lucu.git docs Ditz-issue: e0312227f40a0fa92d4c5d69a64dad473f54389a --- diff --git a/Network/HTTP/Lucu/Dispatcher.hs b/Network/HTTP/Lucu/Dispatcher.hs index a2d07f1..fc7e4a6 100644 --- a/Network/HTTP/Lucu/Dispatcher.hs +++ b/Network/HTTP/Lucu/Dispatcher.hs @@ -1,4 +1,4 @@ --- |Repository of resources that are handled by httpd. +-- |Static and dynamic repositories of resources in an httpd. module Network.HTTP.Lucu.Dispatcher ( HostMapper(..) , HostMap diff --git a/Network/HTTP/Lucu/Dispatcher/Internal.hs b/Network/HTTP/Lucu/Dispatcher/Internal.hs index eea8d46..80effa7 100644 --- a/Network/HTTP/Lucu/Dispatcher/Internal.hs +++ b/Network/HTTP/Lucu/Dispatcher/Internal.hs @@ -36,11 +36,23 @@ import Network.URI hiding (path) import Prelude hiding (filter, foldr, lookup, null) import Prelude.Unicode --- |FIXME: docs +-- |Class of maps from 'Host' to 'ResourceMap' to provide name-based +-- virtual hosts. +-- +-- Note that Lucu currently does not implement neither RFC 2817 +-- connection upgrading () nor RFC +-- 3546 server name indication +-- () so you won't be +-- able to host more than one SSL virtual host on the same port +-- without using wildcard certificates +-- (). -- -- Minimal complete definition: 'findResourceMap' class HostMapper α where + -- |Find a repository of resources for the given host name if any. findResourceMap ∷ Host → α → MaybeT IO ResourceMap + -- |Wrap an instance of 'HostMapper' in a monoidal, homogeneous + -- container. hostMap ∷ α → HostMap {-# INLINE hostMap #-} hostMap = HMap @@ -48,11 +60,18 @@ class HostMapper α where -- |Container type for the 'HostMapper' type class. data HostMap = ∀α. HostMapper α ⇒ HMap α --- |FIXME: docs +-- |Class of maps from resource 'Path' to 'Resource'. -- -- Minimal complete definition: 'findResource' class ResourceMapper α where + -- |Find a resource handler for the given resource path, along + -- with the path where the said handler was found. The found path + -- is usually the same as the queried path, but there are + -- situations where the found path is just a prefix of the queried + -- path. See 'greedy'. findResource ∷ Path → α → MaybeT IO (Path, Resource) + -- |Wrap an instance of 'ResourceMapper' in a monoidal, + -- homogeneous container. resourceMap ∷ α → ResourceMap {-# INLINE resourceMap #-} resourceMap = RMap