| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Web.ServerSession.Backend.Redis
Description
Storage backend for serversession using Redis via hedis.
Synopsis
- data RedisStorage sess = RedisStorage {}
- data RedisStorageException
- = ExpectedTxSuccess (TxResult ())
- | ExpectedRight Reply
- class IsSessionData sess => RedisSession sess where
- toHash :: Proxy sess -> Decomposed sess -> [(ByteString, ByteString)]
- fromHash :: Proxy sess -> [(ByteString, ByteString)] -> Decomposed sess
Documentation
data RedisStorage sess Source #
Session storage backend using Redis via the hedis package.
Constructors
| RedisStorage | |
Fields
| |
Instances
data RedisStorageException Source #
An exception thrown by the serversession-backend-redis
package.
Constructors
| ExpectedTxSuccess (TxResult ()) | We expected |
| ExpectedRight Reply |
Instances
| Show RedisStorageException Source # | |
Defined in Web.ServerSession.Backend.Redis.Internal Methods showsPrec :: Int -> RedisStorageException -> ShowS # show :: RedisStorageException -> String # showList :: [RedisStorageException] -> ShowS # | |
| Exception RedisStorageException Source # | |
Defined in Web.ServerSession.Backend.Redis.Internal | |
class IsSessionData sess => RedisSession sess where Source #
Class for data types that can be used as session data for the Redis backend.
It should hold that
fromHash p . perm . toHash p === id
for all list permutations perm :: [a] -> [a],
where p :: Proxy sess.
Methods
toHash :: Proxy sess -> Decomposed sess -> [(ByteString, ByteString)] Source #
Transform a decomposed session into a Redis hash. Keys
will be prepended with "data:" before being stored.
fromHash :: Proxy sess -> [(ByteString, ByteString)] -> Decomposed sess Source #
Parse back a Redis hash into session data.
Instances
| RedisSession SessionMap Source # | Assumes that keys are UTF-8 encoded when parsing (which is
true if keys are always generated via |
Defined in Web.ServerSession.Backend.Redis.Internal Methods toHash :: Proxy SessionMap -> Decomposed SessionMap -> [(ByteString, ByteString)] Source # fromHash :: Proxy SessionMap -> [(ByteString, ByteString)] -> Decomposed SessionMap Source # | |