Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class (Eq (SessionKey s), Hashable (SessionKey s)) => IsSession s where
- type SessionKey s :: *
- getSessionKey :: s -> SessionKey s
- newtype SessionVault s = SessionVault {
- unSessionVault :: Map (SessionKey s) s
- newSessionVault :: STM (SessionVault s)
- loadSession :: IsSession s => SessionKey s -> SessionVault s -> STM (Maybe s)
- storeSession :: IsSession s => s -> SessionVault s -> STM ()
- deleteSession :: IsSession s => SessionKey s -> SessionVault s -> STM ()
- toList :: SessionVault s -> STM [s]
- filterSessions :: IsSession s => (s -> Bool) -> SessionVault s -> STM ()
- mapSessions :: IsSession s => (s -> STM s) -> SessionVault s -> STM ()
- newStmSessionStore' :: IO (SessionStore (Session conn sess st) STM)
- newStmSessionStore :: IO (SessionStoreInstance (Session conn sess st))
Documentation
class (Eq (SessionKey s), Hashable (SessionKey s)) => IsSession s where Source #
type SessionKey s :: * Source #
getSessionKey :: s -> SessionKey s Source #
Instances
IsSession (Session conn sess st) Source # | |
Defined in Web.Spock.Internal.SessionVault type SessionKey (Session conn sess st) Source # getSessionKey :: Session conn sess st -> SessionKey (Session conn sess st) Source # |
newtype SessionVault s Source #
SessionVault | |
|
newSessionVault :: STM (SessionVault s) Source #
Create a new session vault
loadSession :: IsSession s => SessionKey s -> SessionVault s -> STM (Maybe s) Source #
Load a session
storeSession :: IsSession s => s -> SessionVault s -> STM () Source #
Store a session, overwriting any previous values
deleteSession :: IsSession s => SessionKey s -> SessionVault s -> STM () Source #
Removea session
toList :: SessionVault s -> STM [s] Source #
Get all sessions as list
filterSessions :: IsSession s => (s -> Bool) -> SessionVault s -> STM () Source #
Remove all sessions that do not match the predicate
mapSessions :: IsSession s => (s -> STM s) -> SessionVault s -> STM () Source #
Perform action on all sessions
newStmSessionStore' :: IO (SessionStore (Session conn sess st) STM) Source #
newStmSessionStore :: IO (SessionStoreInstance (Session conn sess st)) Source #