-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Cache Wai Middleware using Redis backend
--   
--   Please see README.md
@package wai-middleware-caching-redis
@version 0.2.0.0

module Network.Wai.Middleware.RedisCache
cache :: RedisCacheBackend -> Middleware
cacheNoBody :: RedisCacheBackend -> Middleware
newCacheBackend :: ConnectInfo -> (Request -> ByteString -> IO Bool) -> (Request -> Response -> IO ()) -> (Request -> Response -> IO ()) -> IO RedisCacheBackend

-- | Cache Backend which cache all GET requests using local redis on
--   standard port You should use <a>cacheNoBody</a> instead of
--   <a>cache</a>
defaultCacheBackend :: IO RedisCacheBackend

-- | Default information for connecting:
--   
--   <pre>
--   connectHost           = "localhost"
--   connectPort           = PortNumber 6379 -- Redis default port
--   connectAuth           = Nothing         -- No password
--   connectDatabase       = 0               -- SELECT database 0
--   connectMaxConnections = 50              -- Up to 50 connections
--   connectMaxIdleTime    = 30              -- Keep open for 30 seconds
--   connectTimeout        = Nothing         -- Don't add timeout logic
--   connectTLSParams      = Nothing         -- Do not use TLS
--   </pre>
defaultConnectInfo :: ConnectInfo

-- | Information for connnecting to a Redis server.
--   
--   It is recommended to not use the <a>ConnInfo</a> data constructor
--   directly. Instead use <a>defaultConnectInfo</a> and update it with
--   record syntax. For example to connect to a password protected Redis
--   server running on localhost and listening to the default port:
--   
--   <pre>
--   myConnectInfo :: ConnectInfo
--   myConnectInfo = defaultConnectInfo {connectAuth = Just "secret"}
--   </pre>
data ConnectInfo :: *
ConnInfo :: HostName -> PortID -> Maybe ByteString -> Integer -> Int -> NominalDiffTime -> Maybe NominalDiffTime -> Maybe ClientParams -> ConnectInfo
[connectHost] :: ConnectInfo -> HostName
[connectPort] :: ConnectInfo -> PortID

-- | When the server is protected by a password, set <a>connectAuth</a> to
--   <a>Just</a> the password. Each connection will then authenticate by
--   the <a>auth</a> command.
[connectAuth] :: ConnectInfo -> Maybe ByteString

-- | Each connection will <a>select</a> the database with the given index.
[connectDatabase] :: ConnectInfo -> Integer

-- | Maximum number of connections to keep open. The smallest acceptable
--   value is 1.
[connectMaxConnections] :: ConnectInfo -> Int

-- | Amount of time for which an unused connection is kept open. The
--   smallest acceptable value is 0.5 seconds. If the <tt>timeout</tt>
--   value in your redis.conf file is non-zero, it should be larger than
--   <a>connectMaxIdleTime</a>.
[connectMaxIdleTime] :: ConnectInfo -> NominalDiffTime

-- | Optional timeout until connection to Redis gets established.
--   <tt>ConnectTimeoutException</tt> gets thrown if no socket get
--   connected in this interval of time.
[connectTimeout] :: ConnectInfo -> Maybe NominalDiffTime

-- | Optional TLS parameters. TLS will be enabled if this is provided.
[connectTLSParams] :: ConnectInfo -> Maybe ClientParams
data PortID :: *
Service :: String -> PortID
PortNumber :: PortNumber -> PortID
UnixSocket :: String -> PortID
instance GHC.Read.Read Network.Wai.Middleware.RedisCache.CacheValue
instance GHC.Show.Show Network.Wai.Middleware.RedisCache.CacheValue
instance GHC.Classes.Ord Network.Wai.Middleware.RedisCache.CacheKey
instance GHC.Classes.Eq Network.Wai.Middleware.RedisCache.CacheKey
instance GHC.Show.Show Network.Wai.Middleware.RedisCache.CacheKey
instance GHC.Read.Read Network.HTTP.Types.Status.Status
