| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Network.TLS.SessionManager.Internal
Description
The implementation of Network.TLS.SessionManager, exposed for testing. This module may change without notice.
Synopsis
- data Config = Config {
- ticketLifetime :: Int
- pruningDelay :: Int
- dbMaxSize :: Int
- defaultConfig :: Config
- toKey :: ByteString -> SessionIDCopy
- toValue :: SessionData -> SessionDataCopy
- fromValue :: SessionDataCopy -> SessionData
- type SessionIDCopy = ShortByteString
- newtype SessionDataCopy = SessionDataCopy SessionData
- type Sec = Int64
- type Value = (SessionDataCopy, IORef Availability)
- type Sessions = OrdPSQ SessionIDCopy Sec Value
- data DB = DB Sessions [SessionIDCopy]
- data Item
- data Use
- data Availability
- newSessionManager :: Config -> IO SessionManager
- cons :: Int -> Item -> DB -> DB
- clean :: Int -> DB -> IO (DB -> DB)
- establish :: Reaper DB Item -> Sec -> SessionID -> SessionData -> IO ()
- resume :: Reaper DB Item -> Use -> SessionID -> IO (Maybe SessionData)
- invalidate :: Reaper DB Item -> SessionID -> IO ()
Documentation
Configuration for session managers.
Constructors
| Config | |
Fields
| |
defaultConfig :: Config Source #
ticketLifetime: 2 hours (7200 seconds), pruningDelay: 10 minutes (600 seconds), dbMaxSize: 1000 entries.
toKey :: ByteString -> SessionIDCopy Source #
toValue :: SessionData -> SessionDataCopy Source #
fromValue :: SessionDataCopy -> SessionData Source #
type SessionIDCopy = ShortByteString Source #
newtype SessionDataCopy Source #
Constructors
| SessionDataCopy SessionData |
Instances
| Show SessionDataCopy Source # | |
Defined in Network.TLS.SessionManager.Internal Methods showsPrec :: Int -> SessionDataCopy -> ShowS show :: SessionDataCopy -> String showList :: [SessionDataCopy] -> ShowS | |
| Eq SessionDataCopy Source # | |
Defined in Network.TLS.SessionManager.Internal Methods (==) :: SessionDataCopy -> SessionDataCopy -> Bool (/=) :: SessionDataCopy -> SessionDataCopy -> Bool | |
type Value = (SessionDataCopy, IORef Availability) Source #
The sessions, and the keys deleted since the reaper last took them away to prune. While it prunes, the workload left in their place is empty, so a deletion there is kept to be applied to the pruned sessions too.
Constructors
| DB Sessions [SessionIDCopy] |
Constructors
| Add SessionIDCopy Sec Value | |
| Del SessionIDCopy |
Constructors
| SingleUse | |
| MultipleUse |
data Availability Source #
newSessionManager :: Config -> IO SessionManager Source #
Creating an in-memory session manager.
invalidate :: Reaper DB Item -> SessionID -> IO () Source #