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

-- | Client library for the Redis datastore: supports full command set,
--   pipelining.
--   
--   Redis is an open source, advanced key-value store. It is often
--   referred to as a data structure server since keys can contain strings,
--   hashes, lists, sets and sorted sets. This library is a Haskell client
--   for the Redis datastore. Compared to other Haskell client libraries it
--   has some advantages:
--   
--   
--   
- Compatibility with Latest Stable Redis: Hedis is intended
--   to be used with the latest stable version of Redis (currently 5.0).
--   Most redis commands (http://redis.io/commands) are available as
--   haskell functions, although MONITOR and SYNC are intentionally
--   omitted. Additionally, a low-level API is exposed that makes it easy
--   for the library user to implement further commands, such as new
--   commands from an experimental Redis version.
--   
- Automatic Optimal Pipelining: Commands are pipelined
--   (http://redis.io/topics/pipelining) as much as possible without
--   any work by the user. See
--   http://informatikr.com/2012/redis-pipelining.html for a
--   technical explanation of automatic optimal pipelining.
--   
- Enforced Pub/Sub semantics: When subscribed to the Redis
--   Pub/Sub server (http://redis.io/topics/pubsub), clients are not
--   allowed to issue commands other than subscribing to or unsubscribing
--   from channels. This library uses the type system to enforce the
--   correct behavior.
--   
- Connect via TCP or Unix Domain Socket: TCP sockets are the
--   default way to connect to a Redis server. For connections to a server
--   on the same machine, Unix domain sockets offer higher performance than
--   the standard TCP connection.
--   
--   
--   For detailed documentation, see the Database.Redis module.
@package hedis
@version 0.15.2

module Database.Redis.Core.Internal

-- | Context for normal command execution, outside of transactions. Use
--   runRedis to run actions of this type.
--   
--   In this context, each result is wrapped in an Either to account
--   for the possibility of Redis returning an Error reply.
newtype Redis a
Redis :: ReaderT RedisEnv IO a -> Redis a
data RedisEnv
NonClusteredEnv :: Connection -> IORef Reply -> RedisEnv
[envConn] :: RedisEnv -> Connection
[envLastReply] :: RedisEnv -> IORef Reply
ClusteredEnv :: IO ShardMap -> Connection -> RedisEnv
[refreshAction] :: RedisEnv -> IO ShardMap
[connection] :: RedisEnv -> Connection
instance GHC.Internal.Base.Applicative Database.Redis.Core.Internal.Redis
instance GHC.Internal.Base.Functor Database.Redis.Core.Internal.Redis
instance GHC.Internal.Control.Monad.Fail.MonadFail Database.Redis.Core.Internal.Redis
instance Control.Monad.IO.Class.MonadIO Database.Redis.Core.Internal.Redis
instance GHC.Internal.Base.Monad Database.Redis.Core.Internal.Redis
instance Control.Monad.IO.Unlift.MonadUnliftIO Database.Redis.Core.Internal.Redis

module Database.Redis

-- | Context for normal command execution, outside of transactions. Use
--   runRedis to run actions of this type.
--   
--   In this context, each result is wrapped in an Either to account
--   for the possibility of Redis returning an Error reply.
data Redis a

-- | Interact with a Redis datastore specified by the given
--   Connection.
--   
--   Each call of runRedis takes a network connection from the
--   Connection pool and runs the given Redis action. Calls
--   to runRedis may thus block while all connections from the pool
--   are in use.
runRedis :: Connection -> Redis a -> IO a

-- | Deconstruct Redis constructor.
--   
--   unRedis and reRedis can be used to define instances for
--   arbitrary typeclasses.
--   
--   WARNING! These functions are considered internal and no guarantee is
--   given at this point that they will not break in future.
unRedis :: Redis a -> ReaderT RedisEnv IO a

-- | Reconstruct Redis constructor.
reRedis :: ReaderT RedisEnv IO a -> Redis a

-- | This class captures the following behaviour: In a context m,
--   a command will return its result wrapped in a "container" of type
--   f.
--   
--   Please refer to the Command Type Signatures section of this page for
--   more information.
class MonadRedis m => RedisCtx (m :: Type -> Type) (f :: Type -> Type) | m -> f
returnDecode :: (RedisCtx m f, RedisResult a) => Reply -> m (f a)
class Monad m => MonadRedis (m :: Type -> Type)
liftRedis :: MonadRedis m => Redis a -> m a

-- | A threadsafe pool of network connections to a Redis server. Use the
--   connect function to create one.
data Connection
data ConnectError
ConnectAuthError :: Reply -> ConnectError
ConnectSelectError :: Reply -> ConnectError

-- | Constructs a Connection pool to a Redis server designated by
--   the given ConnectInfo. The first connection is not actually
--   established until the first call to the server.
connect :: ConnectInfo -> IO Connection

-- | Constructs a Connection pool to a Redis server designated by
--   the given ConnectInfo, then tests if the server is actually
--   there. Throws an exception if the connection to the Redis server can't
--   be established.
checkedConnect :: ConnectInfo -> IO Connection

-- | Destroy all idle resources in the pool.
disconnect :: Connection -> IO ()

-- | Memory bracket around connect and disconnect.
withConnect :: (MonadMask m, MonadIO m) => ConnectInfo -> (Connection -> m c) -> m c

-- | Memory bracket around checkedConnect and disconnect
withCheckedConnect :: ConnectInfo -> (Connection -> IO c) -> IO c

-- | Information for connnecting to a Redis server.
--   
--   It is recommended to not use the ConnInfo data constructor
--   directly. Instead use defaultConnectInfo 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:
--   
--   
--   myConnectInfo :: ConnectInfo
--   myConnectInfo = defaultConnectInfo {connectAuth = Just "secret"}
--   
data ConnectInfo
ConnInfo :: HostName -> PortID -> Maybe ByteString -> Integer -> Int -> NominalDiffTime -> Maybe NominalDiffTime -> Maybe ClientParams -> ConnectInfo

-- | Ignored when connectPort is a UnixSocket
[connectHost] :: ConnectInfo -> HostName
[connectPort] :: ConnectInfo -> PortID

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

-- | Each connection will select 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 timeout
--   value in your redis.conf file is non-zero, it should be larger than
--   connectMaxIdleTime.
[connectMaxIdleTime] :: ConnectInfo -> NominalDiffTime

-- | Optional timeout until connection to Redis gets established.
--   ConnectTimeoutException 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

-- | Default information for connecting:
--   
--   
--   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
--   
defaultConnectInfo :: ConnectInfo

-- | Parse a ConnectInfo from a URL
--   
--   Username is ignored, path is used to specify the database:
--   
--   
--   >>> parseConnectInfo "redis://username:password@host:42/2"
--   Right (ConnInfo {connectHost = "host", connectPort = PortNumber 42, connectAuth = Just "password", connectDatabase = 2, connectMaxConnections = 50, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Nothing})
--   
--   
--   
--   >>> parseConnectInfo "redis://username:password@host:42/db"
--   Left "Invalid port: db"
--   
--   
--   The scheme is validated, to prevent mixing up configurations:
--   
--   
--   >>> parseConnectInfo "postgres://"
--   Left "Wrong scheme"
--   
--   
--   Beyond that, all values are optional. Omitted values are taken from
--   defaultConnectInfo:
--   
--   
--   >>> parseConnectInfo "redis://"
--   Right (ConnInfo {connectHost = "localhost", connectPort = PortNumber 6379, connectAuth = Nothing, connectDatabase = 0, connectMaxConnections = 50, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Nothing})
--   
parseConnectInfo :: String -> Either String ConnectInfo

-- | Constructs a ShardMap of connections to clustered nodes. The
--   argument is a ConnectInfo for any node in the cluster
--   
--   Some Redis commands are currently not supported in cluster mode -
--   CONFIG, AUTH - SCAN - MOVE, SELECT - PUBLISH, SUBSCRIBE, PSUBSCRIBE,
--   UNSUBSCRIBE, PUNSUBSCRIBE, RESET
connectCluster :: ConnectInfo -> IO Connection
data PortID
PortNumber :: PortNumber -> PortID
UnixSocket :: String -> PortID
time :: RedisCtx m f => m (f (Integer, Integer))
data RedisType
None :: RedisType
String :: RedisType
Hash :: RedisType
List :: RedisType
Set :: RedisType
ZSet :: RedisType
wait :: RedisCtx m f => Integer -> Integer -> m (f Integer)

-- | Options for the sort command.
data SortOpts
SortOpts :: Maybe ByteString -> (Integer, Integer) -> [ByteString] -> SortOrder -> Bool -> SortOpts
[sortBy] :: SortOpts -> Maybe ByteString
[sortLimit] :: SortOpts -> (Integer, Integer)
[sortGet] :: SortOpts -> [ByteString]
[sortOrder] :: SortOpts -> SortOrder
[sortAlpha] :: SortOpts -> Bool
get :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
data Aggregate
Sum :: Aggregate
Min :: Aggregate
Max :: Aggregate
sort :: RedisCtx m f => ByteString -> SortOpts -> m (f [ByteString])
migrate :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Integer -> Integer -> m (f Status)
append :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
bitcount :: RedisCtx m f => ByteString -> m (f Integer)
keys :: RedisCtx m f => ByteString -> m (f [ByteString])
select :: RedisCtx m f => Integer -> m (f Status)
scan :: RedisCtx m f => Cursor -> m (f (Cursor, [ByteString]))
data XReadResponse
XReadResponse :: ByteString -> [StreamsRecord] -> XReadResponse
[stream] :: XReadResponse -> ByteString
[records] :: XReadResponse -> [StreamsRecord]
rename :: RedisCtx m f => ByteString -> ByteString -> m (f Status)
ping :: RedisCtx m f => m (f Status)
auth :: RedisCtx m f => ByteString -> m (f Status)
clusterSlots :: RedisCtx m f => m (f ClusterSlotsResponse)
command :: RedisCtx m f => m (f [CommandInfo])
data ClusterSlotsResponse
ClusterSlotsResponse :: [ClusterSlotsResponseEntry] -> ClusterSlotsResponse
[clusterSlotsResponseEntries] :: ClusterSlotsResponse -> [ClusterSlotsResponseEntry]
data ClusterSlotsResponseEntry
ClusterSlotsResponseEntry :: Int -> Int -> ClusterSlotsNode -> [ClusterSlotsNode] -> ClusterSlotsResponseEntry
[clusterSlotsResponseEntryStartSlot] :: ClusterSlotsResponseEntry -> Int
[clusterSlotsResponseEntryEndSlot] :: ClusterSlotsResponseEntry -> Int
[clusterSlotsResponseEntryMaster] :: ClusterSlotsResponseEntry -> ClusterSlotsNode
[clusterSlotsResponseEntryReplicas] :: ClusterSlotsResponseEntry -> [ClusterSlotsNode]
data ClusterSlotsNode
ClusterSlotsNode :: ByteString -> Int -> ByteString -> ClusterSlotsNode
[clusterSlotsNodeIP] :: ClusterSlotsNode -> ByteString
[clusterSlotsNodePort] :: ClusterSlotsNode -> Int
[clusterSlotsNodeID] :: ClusterSlotsNode -> ByteString
echo :: RedisCtx m f => ByteString -> m (f ByteString)
quit :: RedisCtx m f => m (f Status)
del :: RedisCtx m f => [ByteString] -> m (f Integer)
dump :: RedisCtx m f => ByteString -> m (f ByteString)
exists :: RedisCtx m f => ByteString -> m (f Bool)
expire :: RedisCtx m f => ByteString -> Integer -> m (f Bool)
expireat :: RedisCtx m f => ByteString -> Integer -> m (f Bool)

-- | Options for the migrate command.
data MigrateOpts
MigrateOpts :: Bool -> Bool -> MigrateOpts
[migrateCopy] :: MigrateOpts -> Bool
[migrateReplace] :: MigrateOpts -> Bool

-- | Redis default MigrateOpts. Equivalent to omitting all optional
--   parameters.
--   
--   
--   MigrateOpts
--       { migrateCopy    = False -- remove the key from the local instance
--       , migrateReplace = False -- don't replace existing key on the remote instance
--       }
--   
defaultMigrateOpts :: MigrateOpts
migrateMultiple :: RedisCtx m f => ByteString -> ByteString -> Integer -> Integer -> MigrateOpts -> [ByteString] -> m (f Status)
move :: RedisCtx m f => ByteString -> Integer -> m (f Bool)
objectRefcount :: RedisCtx m f => ByteString -> m (f Integer)
objectEncoding :: RedisCtx m f => ByteString -> m (f ByteString)
objectIdletime :: RedisCtx m f => ByteString -> m (f Integer)
persist :: RedisCtx m f => ByteString -> m (f Bool)
pexpire :: RedisCtx m f => ByteString -> Integer -> m (f Bool)
pexpireat :: RedisCtx m f => ByteString -> Integer -> m (f Bool)
pttl :: RedisCtx m f => ByteString -> m (f Integer)
randomkey :: RedisCtx m f => m (f (Maybe ByteString))
renamenx :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
restore :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
restoreReplace :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
data Cursor
cursor0 :: Cursor
data ScanOpts
ScanOpts :: Maybe ByteString -> Maybe Integer -> ScanOpts
[scanMatch] :: ScanOpts -> Maybe ByteString
[scanCount] :: ScanOpts -> Maybe Integer

-- | Redis default ScanOpts. Equivalent to omitting all optional
--   parameters.
--   
--   
--   ScanOpts
--       { scanMatch = Nothing -- don't match any pattern
--       , scanCount = Nothing -- don't set any requirements on number elements returned (works like value COUNT 10)
--       }
--   
defaultScanOpts :: ScanOpts
scanOpts :: RedisCtx m f => Cursor -> ScanOpts -> m (f (Cursor, [ByteString]))

-- | Redis default SortOpts. Equivalent to omitting all optional
--   parameters.
--   
--   
--   SortOpts
--       { sortBy    = Nothing -- omit the BY option
--       , sortLimit = (0,-1)  -- return entire collection
--       , sortGet   = []      -- omit the GET option
--       , sortOrder = Asc     -- sort in ascending order
--       , sortAlpha = False   -- sort numerically, not lexicographically
--       }
--   
defaultSortOpts :: SortOpts
data SortOrder
Asc :: SortOrder
Desc :: SortOrder
sortStore :: RedisCtx m f => ByteString -> ByteString -> SortOpts -> m (f Integer)
ttl :: RedisCtx m f => ByteString -> m (f Integer)
getType :: RedisCtx m f => ByteString -> m (f RedisType)
hdel :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
hexists :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
hget :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe ByteString))
hgetall :: RedisCtx m f => ByteString -> m (f [(ByteString, ByteString)])
hincrby :: RedisCtx m f => ByteString -> ByteString -> Integer -> m (f Integer)
hincrbyfloat :: RedisCtx m f => ByteString -> ByteString -> Double -> m (f Double)
hkeys :: RedisCtx m f => ByteString -> m (f [ByteString])
hlen :: RedisCtx m f => ByteString -> m (f Integer)
hmget :: RedisCtx m f => ByteString -> [ByteString] -> m (f [Maybe ByteString])
hmset :: RedisCtx m f => ByteString -> [(ByteString, ByteString)] -> m (f Status)
hscan :: RedisCtx m f => ByteString -> Cursor -> m (f (Cursor, [(ByteString, ByteString)]))
hscanOpts :: RedisCtx m f => ByteString -> Cursor -> ScanOpts -> m (f (Cursor, [(ByteString, ByteString)]))
hset :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
hsetnx :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Bool)
hstrlen :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
hvals :: RedisCtx m f => ByteString -> m (f [ByteString])
pfadd :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
pfcount :: RedisCtx m f => [ByteString] -> m (f Integer)
pfmerge :: RedisCtx m f => ByteString -> [ByteString] -> m (f ByteString)
blpop :: RedisCtx m f => [ByteString] -> Integer -> m (f (Maybe (ByteString, ByteString)))
brpop :: RedisCtx m f => [ByteString] -> Integer -> m (f (Maybe (ByteString, ByteString)))
brpoplpush :: RedisCtx m f => ByteString -> ByteString -> Integer -> m (f (Maybe ByteString))
lindex :: RedisCtx m f => ByteString -> Integer -> m (f (Maybe ByteString))
linsertBefore :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
linsertAfter :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
llen :: RedisCtx m f => ByteString -> m (f Integer)
lpop :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
lpush :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
lpushx :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
lrange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [ByteString])
lrem :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Integer)
lset :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
ltrim :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f Status)
rpop :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
rpoplpush :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe ByteString))
rpush :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
rpushx :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
eval :: (RedisCtx m f, RedisResult a) => ByteString -> [ByteString] -> [ByteString] -> m (f a)

-- | Works like eval, but sends the SHA1 hash of the script instead
--   of the script itself. Fails if the server does not recognise the hash,
--   in which case, eval should be used instead.
evalsha :: (RedisCtx m f, RedisResult a) => ByteString -> [ByteString] -> [ByteString] -> m (f a)
data DebugMode
scriptDebug :: RedisCtx m f => DebugMode -> m (f Bool)
scriptExists :: RedisCtx m f => [ByteString] -> m (f [Bool])
scriptFlush :: RedisCtx m f => m (f Status)
scriptKill :: RedisCtx m f => m (f Status)
scriptLoad :: RedisCtx m f => ByteString -> m (f ByteString)
bgrewriteaof :: RedisCtx m f => m (f Status)
bgsave :: RedisCtx m f => m (f Status)
clientGetname :: RedisCtx m f => m (f Status)
clientList :: RedisCtx m f => m (f [ByteString])
clientPause :: RedisCtx m f => Integer -> m (f Status)
data ReplyMode
clientReply :: RedisCtx m f => ReplyMode -> m (f Bool)
clientSetname :: RedisCtx m f => ByteString -> m (f ByteString)
commandCount :: RedisCtx m f => m (f Integer)
commandInfo :: RedisCtx m f => [ByteString] -> m (f [ByteString])
configGet :: RedisCtx m f => ByteString -> m (f [(ByteString, ByteString)])
configResetstat :: RedisCtx m f => m (f Status)
configRewrite :: RedisCtx m f => m (f Status)
configSet :: RedisCtx m f => ByteString -> ByteString -> m (f Status)
dbsize :: RedisCtx m f => m (f Integer)
debugObject :: RedisCtx m f => ByteString -> m (f ByteString)
flushall :: RedisCtx m f => m (f Status)
flushdb :: RedisCtx m f => m (f Status)
info :: RedisCtx m f => m (f ByteString)
infoSection :: RedisCtx m f => ByteString -> m (f ByteString)
lastsave :: RedisCtx m f => m (f Integer)
save :: RedisCtx m f => m (f Status)
slaveof :: RedisCtx m f => ByteString -> ByteString -> m (f Status)

-- | A single entry from the slowlog.
data Slowlog
Slowlog :: Integer -> Integer -> Integer -> [ByteString] -> Maybe ByteString -> Maybe ByteString -> Slowlog

-- | A unique progressive identifier for every slow log entry.
[slowlogId] :: Slowlog -> Integer

-- | The unix timestamp at which the logged command was processed.
[slowlogTimestamp] :: Slowlog -> Integer

-- | The amount of time needed for its execution, in microseconds.
[slowlogMicros] :: Slowlog -> Integer

-- | The command and it's arguments.
[slowlogCmd] :: Slowlog -> [ByteString]
[slowlogClientIpAndPort] :: Slowlog -> Maybe ByteString
[slowlogClientName] :: Slowlog -> Maybe ByteString
slowlogGet :: RedisCtx m f => Integer -> m (f [Slowlog])
slowlogLen :: RedisCtx m f => m (f Integer)
slowlogReset :: RedisCtx m f => m (f Status)
sadd :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
scard :: RedisCtx m f => ByteString -> m (f Integer)
sdiff :: RedisCtx m f => [ByteString] -> m (f [ByteString])
sdiffstore :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
sinter :: RedisCtx m f => [ByteString] -> m (f [ByteString])
sinterstore :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
sismember :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
smembers :: RedisCtx m f => ByteString -> m (f [ByteString])
smove :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Bool)
spop :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
spopN :: RedisCtx m f => ByteString -> Integer -> m (f [ByteString])
srandmember :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
srandmemberN :: RedisCtx m f => ByteString -> Integer -> m (f [ByteString])
srem :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
sscan :: RedisCtx m f => ByteString -> Cursor -> m (f (Cursor, [ByteString]))
sscanOpts :: RedisCtx m f => ByteString -> Cursor -> ScanOpts -> m (f (Cursor, [ByteString]))
sunion :: RedisCtx m f => [ByteString] -> m (f [ByteString])
sunionstore :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
data ZaddOpts
ZaddOpts :: Maybe Condition -> Bool -> Bool -> ZaddOpts
[zaddCondition] :: ZaddOpts -> Maybe Condition
[zaddChange] :: ZaddOpts -> Bool
[zaddIncrement] :: ZaddOpts -> Bool

-- | Redis default ZaddOpts. Equivalent to omitting all optional
--   parameters.
--   
--   
--   ZaddOpts
--       { zaddCondition = Nothing -- omit NX and XX options
--       , zaddChange    = False   -- don't modify the return value from the number of new elements added, to the total number of elements changed
--       , zaddIncrement = False   -- don't add like ZINCRBY
--       }
--   
defaultZaddOpts :: ZaddOpts
zadd :: RedisCtx m f => ByteString -> [(Double, ByteString)] -> m (f Integer)
zaddOpts :: RedisCtx m f => ByteString -> [(Double, ByteString)] -> ZaddOpts -> m (f Integer)
zcard :: RedisCtx m f => ByteString -> m (f Integer)
zcount :: RedisCtx m f => ByteString -> Double -> Double -> m (f Integer)
zincrby :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Double)
zinterstore :: RedisCtx m f => ByteString -> [ByteString] -> Aggregate -> m (f Integer)
zinterstoreWeights :: RedisCtx m f => ByteString -> [(ByteString, Double)] -> Aggregate -> m (f Integer)
zlexcount :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
zrange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [ByteString])
zrangeWithscores :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [(ByteString, Double)])
data RangeLex a
Incl :: a -> RangeLex a
Excl :: a -> RangeLex a
Minr :: RangeLex a
Maxr :: RangeLex a
zrangebylex :: RedisCtx m f => ByteString -> RangeLex ByteString -> RangeLex ByteString -> m (f [ByteString])
zrangebylexLimit :: RedisCtx m f => ByteString -> RangeLex ByteString -> RangeLex ByteString -> Integer -> Integer -> m (f [ByteString])
zrangebyscore :: RedisCtx m f => ByteString -> Double -> Double -> m (f [ByteString])
zrangebyscoreWithscores :: RedisCtx m f => ByteString -> Double -> Double -> m (f [(ByteString, Double)])
zrangebyscoreLimit :: RedisCtx m f => ByteString -> Double -> Double -> Integer -> Integer -> m (f [ByteString])
zrangebyscoreWithscoresLimit :: RedisCtx m f => ByteString -> Double -> Double -> Integer -> Integer -> m (f [(ByteString, Double)])
zrank :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe Integer))
zrem :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
zremrangebylex :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
zremrangebyrank :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f Integer)
zremrangebyscore :: RedisCtx m f => ByteString -> Double -> Double -> m (f Integer)
zrevrange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [ByteString])
zrevrangeWithscores :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [(ByteString, Double)])
zrevrangebyscore :: RedisCtx m f => ByteString -> Double -> Double -> m (f [ByteString])
zrevrangebyscoreWithscores :: RedisCtx m f => ByteString -> Double -> Double -> m (f [(ByteString, Double)])
zrevrangebyscoreLimit :: RedisCtx m f => ByteString -> Double -> Double -> Integer -> Integer -> m (f [ByteString])
zrevrangebyscoreWithscoresLimit :: RedisCtx m f => ByteString -> Double -> Double -> Integer -> Integer -> m (f [(ByteString, Double)])
zrevrank :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe Integer))
zscan :: RedisCtx m f => ByteString -> Cursor -> m (f (Cursor, [(ByteString, Double)]))
zscanOpts :: RedisCtx m f => ByteString -> Cursor -> ScanOpts -> m (f (Cursor, [(ByteString, Double)]))
zscore :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe Double))
zunionstore :: RedisCtx m f => ByteString -> [ByteString] -> Aggregate -> m (f Integer)
zunionstoreWeights :: RedisCtx m f => ByteString -> [(ByteString, Double)] -> Aggregate -> m (f Integer)
bitcountRange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f Integer)
bitopAnd :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
bitopOr :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
bitopXor :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
bitopNot :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
bitpos :: RedisCtx m f => ByteString -> Integer -> Integer -> Integer -> m (f Integer)
decr :: RedisCtx m f => ByteString -> m (f Integer)
decrby :: RedisCtx m f => ByteString -> Integer -> m (f Integer)
getbit :: RedisCtx m f => ByteString -> Integer -> m (f Integer)
getrange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f ByteString)
getset :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe ByteString))
incr :: RedisCtx m f => ByteString -> m (f Integer)
incrby :: RedisCtx m f => ByteString -> Integer -> m (f Integer)
incrbyfloat :: RedisCtx m f => ByteString -> Double -> m (f Double)
mget :: RedisCtx m f => [ByteString] -> m (f [Maybe ByteString])
mset :: RedisCtx m f => [(ByteString, ByteString)] -> m (f Status)
msetnx :: RedisCtx m f => [(ByteString, ByteString)] -> m (f Bool)
psetex :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
data Condition
Nx :: Condition
Xx :: Condition
data SetOpts
SetOpts :: Maybe Integer -> Maybe Integer -> Maybe Condition -> SetOpts
[setSeconds] :: SetOpts -> Maybe Integer
[setMilliseconds] :: SetOpts -> Maybe Integer
[setCondition] :: SetOpts -> Maybe Condition
set :: RedisCtx m f => ByteString -> ByteString -> m (f Status)
setOpts :: RedisCtx m f => ByteString -> ByteString -> SetOpts -> m (f Status)
setbit :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Integer)
setex :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
setnx :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
setrange :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Integer)
strlen :: RedisCtx m f => ByteString -> m (f Integer)
data XReadOpts
XReadOpts :: Maybe Integer -> Maybe Integer -> XReadOpts
[block] :: XReadOpts -> Maybe Integer
[recordCount] :: XReadOpts -> Maybe Integer

-- | Redis default XReadOpts. Equivalent to omitting all optional
--   parameters.
--   
--   
--   XReadOpts
--       { block = Nothing -- Don't block waiting for more records
--       , recordCount    = Nothing   -- no record count
--       }
--   
defaultXreadOpts :: XReadOpts
data StreamsRecord
StreamsRecord :: ByteString -> [(ByteString, ByteString)] -> StreamsRecord
[recordId] :: StreamsRecord -> ByteString
[keyValues] :: StreamsRecord -> [(ByteString, ByteString)]
data TrimOpts
NoArgs :: TrimOpts
Maxlen :: Integer -> TrimOpts
ApproxMaxlen :: Integer -> TrimOpts
xadd :: RedisCtx m f => ByteString -> ByteString -> [(ByteString, ByteString)] -> m (f ByteString)
xaddOpts :: RedisCtx m f => ByteString -> ByteString -> [(ByteString, ByteString)] -> TrimOpts -> m (f ByteString)
xread :: RedisCtx m f => [(ByteString, ByteString)] -> m (f (Maybe [XReadResponse]))
xreadOpts :: RedisCtx m f => [(ByteString, ByteString)] -> XReadOpts -> m (f (Maybe [XReadResponse]))
xreadGroup :: RedisCtx m f => ByteString -> ByteString -> [(ByteString, ByteString)] -> m (f (Maybe [XReadResponse]))
xreadGroupOpts :: RedisCtx m f => ByteString -> ByteString -> [(ByteString, ByteString)] -> XReadOpts -> m (f (Maybe [XReadResponse]))
xack :: RedisCtx m f => ByteString -> ByteString -> [ByteString] -> m (f Integer)
xgroupCreate :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Status)
xgroupSetId :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Status)
xgroupDestroy :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
xgroupDelConsumer :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
xrange :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Maybe Integer -> m (f [StreamsRecord])
xrevRange :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Maybe Integer -> m (f [StreamsRecord])
xlen :: RedisCtx m f => ByteString -> m (f Integer)
data XPendingSummaryResponse
XPendingSummaryResponse :: Integer -> ByteString -> ByteString -> [(ByteString, Integer)] -> XPendingSummaryResponse
[numPendingMessages] :: XPendingSummaryResponse -> Integer
[smallestPendingMessageId] :: XPendingSummaryResponse -> ByteString
[largestPendingMessageId] :: XPendingSummaryResponse -> ByteString
[numPendingMessagesByconsumer] :: XPendingSummaryResponse -> [(ByteString, Integer)]
xpendingSummary :: RedisCtx m f => ByteString -> ByteString -> Maybe ByteString -> m (f XPendingSummaryResponse)
data XPendingDetailRecord
XPendingDetailRecord :: ByteString -> ByteString -> Integer -> Integer -> XPendingDetailRecord
[messageId] :: XPendingDetailRecord -> ByteString
[consumer] :: XPendingDetailRecord -> ByteString
[millisSinceLastDelivered] :: XPendingDetailRecord -> Integer
[numTimesDelivered] :: XPendingDetailRecord -> Integer
xpendingDetail :: RedisCtx m f => ByteString -> ByteString -> ByteString -> ByteString -> Integer -> Maybe ByteString -> m (f [XPendingDetailRecord])
data XClaimOpts
XClaimOpts :: Maybe Integer -> Maybe Integer -> Maybe Integer -> Bool -> XClaimOpts
[xclaimIdle] :: XClaimOpts -> Maybe Integer
[xclaimTime] :: XClaimOpts -> Maybe Integer
[xclaimRetryCount] :: XClaimOpts -> Maybe Integer
[xclaimForce] :: XClaimOpts -> Bool
defaultXClaimOpts :: XClaimOpts
xclaim :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Integer -> XClaimOpts -> [ByteString] -> m (f [StreamsRecord])
xclaimJustIds :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Integer -> XClaimOpts -> [ByteString] -> m (f [ByteString])
data XInfoConsumersResponse
XInfoConsumersResponse :: ByteString -> Integer -> Integer -> XInfoConsumersResponse
[xinfoConsumerName] :: XInfoConsumersResponse -> ByteString
[xinfoConsumerNumPendingMessages] :: XInfoConsumersResponse -> Integer
[xinfoConsumerIdleTime] :: XInfoConsumersResponse -> Integer
xinfoConsumers :: RedisCtx m f => ByteString -> ByteString -> m (f [XInfoConsumersResponse])
data XInfoGroupsResponse
XInfoGroupsResponse :: ByteString -> Integer -> Integer -> ByteString -> XInfoGroupsResponse
[xinfoGroupsGroupName] :: XInfoGroupsResponse -> ByteString
[xinfoGroupsNumConsumers] :: XInfoGroupsResponse -> Integer
[xinfoGroupsNumPendingMessages] :: XInfoGroupsResponse -> Integer
[xinfoGroupsLastDeliveredMessageId] :: XInfoGroupsResponse -> ByteString
xinfoGroups :: RedisCtx m f => ByteString -> m (f [XInfoGroupsResponse])
data XInfoStreamResponse
XInfoStreamResponse :: Integer -> Integer -> Integer -> Integer -> ByteString -> StreamsRecord -> StreamsRecord -> XInfoStreamResponse
[xinfoStreamLength] :: XInfoStreamResponse -> Integer
[xinfoStreamRadixTreeKeys] :: XInfoStreamResponse -> Integer
[xinfoStreamRadixTreeNodes] :: XInfoStreamResponse -> Integer
[xinfoStreamNumGroups] :: XInfoStreamResponse -> Integer
[xinfoStreamLastEntryId] :: XInfoStreamResponse -> ByteString
[xinfoStreamFirstEntry] :: XInfoStreamResponse -> StreamsRecord
[xinfoStreamLastEntry] :: XInfoStreamResponse -> StreamsRecord
XInfoStreamEmptyResponse :: Integer -> Integer -> Integer -> Integer -> ByteString -> XInfoStreamResponse
[xinfoStreamLength] :: XInfoStreamResponse -> Integer
[xinfoStreamRadixTreeKeys] :: XInfoStreamResponse -> Integer
[xinfoStreamRadixTreeNodes] :: XInfoStreamResponse -> Integer
[xinfoStreamNumGroups] :: XInfoStreamResponse -> Integer
[xinfoStreamLastEntryId] :: XInfoStreamResponse -> ByteString
xinfoStream :: RedisCtx m f => ByteString -> m (f XInfoStreamResponse)
xdel :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
xtrim :: RedisCtx m f => ByteString -> TrimOpts -> m (f Integer)
inf :: RealFloat a => a
data ClusterNodesResponse
ClusterNodesResponse :: [ClusterNodesResponseEntry] -> ClusterNodesResponse
[clusterNodesResponseEntries] :: ClusterNodesResponse -> [ClusterNodesResponseEntry]
data ClusterNodesResponseEntry
ClusterNodesResponseEntry :: ByteString -> ByteString -> Integer -> [ByteString] -> Maybe ByteString -> Integer -> Integer -> Integer -> ByteString -> [ClusterNodesResponseSlotSpec] -> ClusterNodesResponseEntry
[clusterNodesResponseNodeId] :: ClusterNodesResponseEntry -> ByteString
[clusterNodesResponseNodeIp] :: ClusterNodesResponseEntry -> ByteString
[clusterNodesResponseNodePort] :: ClusterNodesResponseEntry -> Integer
[clusterNodesResponseNodeFlags] :: ClusterNodesResponseEntry -> [ByteString]
[clusterNodesResponseMasterId] :: ClusterNodesResponseEntry -> Maybe ByteString
[clusterNodesResponsePingSent] :: ClusterNodesResponseEntry -> Integer
[clusterNodesResponsePongReceived] :: ClusterNodesResponseEntry -> Integer
[clusterNodesResponseConfigEpoch] :: ClusterNodesResponseEntry -> Integer
[clusterNodesResponseLinkState] :: ClusterNodesResponseEntry -> ByteString
[clusterNodesResponseSlots] :: ClusterNodesResponseEntry -> [ClusterNodesResponseSlotSpec]
data ClusterNodesResponseSlotSpec
ClusterNodesResponseSingleSlot :: Integer -> ClusterNodesResponseSlotSpec
ClusterNodesResponseSlotRange :: Integer -> Integer -> ClusterNodesResponseSlotSpec
ClusterNodesResponseSlotImporting :: Integer -> ByteString -> ClusterNodesResponseSlotSpec
ClusterNodesResponseSlotMigrating :: Integer -> ByteString -> ClusterNodesResponseSlotSpec
clusterNodes :: RedisCtx m f => m (f ClusterNodesResponse)
clusterSetSlotNode :: RedisCtx m f => Integer -> ByteString -> m (f Status)
clusterSetSlotStable :: RedisCtx m f => Integer -> m (f Status)
clusterSetSlotImporting :: RedisCtx m f => Integer -> ByteString -> m (f Status)
clusterSetSlotMigrating :: RedisCtx m f => Integer -> ByteString -> m (f Status)
clusterGetKeysInSlot :: RedisCtx m f => Integer -> Integer -> m (f [ByteString])

-- | Watch the given keys to determine execution of the MULTI/EXEC block
--   (http://redis.io/commands/watch).
watch :: [ByteString] -> Redis (Either Reply Status)

-- | Forget about all watched keys
--   (http://redis.io/commands/unwatch).
unwatch :: Redis (Either Reply Status)

-- | Run commands inside a transaction. For documentation on the semantics
--   of Redis transaction see http://redis.io/topics/transactions.
--   
--   Inside the transaction block, command functions return their result
--   wrapped in a Queued. The Queued result is a proxy object
--   for the actual command's result, which will only be available after
--   EXECing the transaction.
--   
--   Example usage (note how Queued 's Applicative instance
--   is used to combine the two individual results):
--   
--   
--   runRedis conn $ do
--       set "hello" "hello"
--       set "world" "world"
--       helloworld <- multiExec $ do
--           hello <- get "hello"
--           world <- get "world"
--           return $ (,) <$> hello <*> world
--       liftIO (print helloworld)
--   
--   
multiExec :: RedisTx (Queued a) -> Redis (TxResult a)

-- | A Queued value represents the result of a command inside a
--   transaction. It is a proxy object for the actual result, which
--   will only be available after returning from a multiExec
--   transaction.
--   
--   Queued values are composable by utilizing the Functor,
--   Applicative or Monad interfaces.
data Queued a

-- | Result of a multiExec transaction.
data TxResult a

-- | Transaction completed successfully. The wrapped value corresponds to
--   the Queued value returned from the multiExec argument
--   action.
TxSuccess :: a -> TxResult a

-- | Transaction aborted due to an earlier watch command.
TxAborted :: TxResult a

-- | At least one of the commands returned an Error reply.
TxError :: String -> TxResult a

-- | Command-context inside of MULTI/EXEC transactions. Use
--   multiExec to run actions of this type.
--   
--   In the RedisTx context, all commands return a Queued
--   value. It is a proxy object for the actual result, which will
--   only be available after finishing the transaction.
data RedisTx a
data Message
Message :: ByteString -> ByteString -> Message
[msgChannel] :: Message -> ByteString
[msgMessage] :: Message -> ByteString
PMessage :: ByteString -> ByteString -> ByteString -> Message
[msgPattern] :: Message -> ByteString
[msgChannel] :: Message -> ByteString
[msgMessage] :: Message -> ByteString

-- | Encapsulates subscription changes. Use subscribe,
--   unsubscribe, psubscribe, punsubscribe or
--   mempty to construct a value. Combine values by using the
--   Monoid interface, i.e. mappend and mconcat.
data PubSub

-- | Post a message to a channel (http://redis.io/commands/publish).
publish :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)

-- | Listens to published messages on subscribed channels and channels
--   matching the subscribed patterns. For documentation on the semantics
--   of Redis Pub/Sub see http://redis.io/topics/pubsub.
--   
--   The given callback function is called for each received message.
--   Subscription changes are triggered by the returned PubSub. To
--   keep subscriptions unchanged, the callback can return mempty.
--   
--   Example: Subscribe to the "news" channel indefinitely.
--   
--   
--   pubSub (subscribe ["news"]) $ \msg -> do
--       putStrLn $ "Message from " ++ show (msgChannel msg)
--       return mempty
--   
--   
--   
--   Example: Receive a single message from the "chat" channel.
--   
--   
--   pubSub (subscribe ["chat"]) $ \msg -> do
--       putStrLn $ "Message from " ++ show (msgChannel msg)
--       return $ unsubscribe ["chat"]
--   
--   
--   
--   It should be noted that Redis Pub/Sub by its nature is asynchronous so
--   returning unsubscribe does not mean that callback won't be able
--   to receive any further messages. And to guarantee that you won't won't
--   process messages after unsubscription and won't unsubscribe from the
--   same channel more than once you need to use IORef or
--   something similar
pubSub :: PubSub -> (Message -> IO PubSub) -> Redis ()

-- | Listen for messages published to the given channels
--   (http://redis.io/commands/subscribe).
subscribe :: [ByteString] -> PubSub

-- | Stop listening for messages posted to the given channels
--   (http://redis.io/commands/unsubscribe).
unsubscribe :: [ByteString] -> PubSub

-- | Listen for messages published to channels matching the given patterns
--   (http://redis.io/commands/psubscribe).
psubscribe :: [ByteString] -> PubSub

-- | Stop listening for messages posted to channels matching the given
--   patterns (http://redis.io/commands/punsubscribe).
punsubscribe :: [ByteString] -> PubSub

-- | Open a connection to the Redis server, register to all channels in the
--   PubSubController, and process messages and subscription change
--   requests forever. The only way this will ever exit is if there is an
--   exception from the network code or an unhandled exception in a
--   MessageCallback or PMessageCallback. For example, if the
--   network connection to Redis dies, pubSubForever will throw a
--   ConnectionLost. When such an exception is thrown, you can
--   recall pubSubForever with the same PubSubController
--   which will open a new connection and resubscribe to all the channels
--   which are tracked in the PubSubController.
--   
--   The general pattern is therefore during program startup create a
--   PubSubController and fork a thread which calls
--   pubSubForever in a loop (using an exponential backoff algorithm
--   such as the retry package to not hammer the Redis server if it
--   does die). For example,
--   
--   
--   myhandler :: ByteString -> IO ()
--   myhandler msg = putStrLn $ unpack $ decodeUtf8 msg
--   
--   onInitialComplete :: IO ()
--   onInitialComplete = putStrLn "Redis acknowledged that mychannel is now subscribed"
--   
--   main :: IO ()
--   main = do
--     conn <- connect defaultConnectInfo
--     pubSubCtrl <- newPubSubController [("mychannel", myhandler)] []
--     concurrently ( forever $
--         pubSubForever conn pubSubCtrl onInitialComplete
--           `catch` (\(e :: SomeException) -> do
--             putStrLn $ "Got error: " ++ show e
--             threadDelay $ 50*1000) -- TODO: use exponential backoff
--          ) $ restOfYourProgram
--   
--   
--     {- elsewhere in your program, use pubSubCtrl to change subscriptions -}
--   
--   
--   At most one active pubSubForever can be running against a
--   single PubSubController at any time. If two active calls to
--   pubSubForever share a single PubSubController there will
--   be deadlocks. If you do want to process messages using multiple
--   connections to Redis, you can create more than one
--   PubSubController. For example, create one PubSubController for
--   each getNumCapabilities and then create a Haskell thread bound
--   to each capability each calling pubSubForever in a loop. This
--   will create one network connection per controller/capability and allow
--   you to register separate channels and callbacks for each controller,
--   spreading the load across the capabilities.
pubSubForever :: Connection -> PubSubController -> IO () -> IO ()

-- | A Redis channel name
type RedisChannel = ByteString

-- | A Redis pattern channel name
type RedisPChannel = ByteString

-- | A handler for a message from a subscribed channel. The callback is
--   passed the message content.
--   
--   Messages are processed synchronously in the receiving thread, so if
--   the callback takes a long time it will block other callbacks and other
--   messages from being received. If you need to move long-running work to
--   a different thread, we suggest you use TBQueue with a
--   reasonable bound, so that if messages are arriving faster than you can
--   process them, you do eventually block.
--   
--   If the callback throws an exception, the exception will be thrown from
--   pubSubForever which will cause the entire Redis connection for
--   all subscriptions to be closed. As long as you call
--   pubSubForever in a loop you will reconnect to your subscribed
--   channels, but you should probably add an exception handler to each
--   callback to prevent this.
type MessageCallback = ByteString -> IO ()

-- | A handler for a message from a psubscribed channel. The callback is
--   passed the channel the message was sent on plus the message content.
--   
--   Similar to MessageCallback, callbacks are executed
--   synchronously and any exceptions are rethrown from
--   pubSubForever.
type PMessageCallback = RedisChannel -> ByteString -> IO ()

-- | A controller that stores a set of channels, pattern channels, and
--   callbacks. It allows you to manage Pub/Sub subscriptions and pattern
--   subscriptions and alter them at any time throughout the life of your
--   program. You should typically create the controller at the start of
--   your program and then store it through the life of your program, using
--   addChannels and removeChannels to update the current
--   subscriptions.
data PubSubController

-- | Create a new PubSubController. Note that this does not
--   subscribe to any channels, it just creates the controller. The
--   subscriptions will happen once pubSubForever is called.
newPubSubController :: MonadIO m => [(RedisChannel, MessageCallback)] -> [(RedisPChannel, PMessageCallback)] -> m PubSubController

-- | Get the list of current channels in the PubSubController.
--   WARNING! This might not exactly reflect the subscribed channels in the
--   Redis server, because there is a delay between adding or removing a
--   channel in the PubSubController and when Redis receives and
--   processes the subscription change request.
currentChannels :: MonadIO m => PubSubController -> m [RedisChannel]

-- | Get the list of current pattern channels in the
--   PubSubController. WARNING! This might not exactly reflect the
--   subscribed channels in the Redis server, because there is a delay
--   between adding or removing a channel in the PubSubController
--   and when Redis receives and processes the subscription change request.
currentPChannels :: MonadIO m => PubSubController -> m [RedisPChannel]

-- | Add channels into the PubSubController, and if there is an
--   active pubSubForever, send the subscribe and psubscribe
--   commands to Redis. The addChannels function is thread-safe.
--   This function does not wait for Redis to acknowledge that the channels
--   have actually been subscribed; use addChannelsAndWait for that.
--   
--   You can subscribe to the same channel or pattern channel multiple
--   times; the PubSubController keeps a list of callbacks and
--   executes each callback in response to a message.
--   
--   The return value is an action UnregisterCallbacksAction which
--   will unregister the callbacks, which should typically used with
--   bracket.
addChannels :: MonadIO m => PubSubController -> [(RedisChannel, MessageCallback)] -> [(RedisPChannel, PMessageCallback)] -> m UnregisterCallbacksAction

-- | Call addChannels and then wait for Redis to acknowledge that
--   the channels are actually subscribed.
--   
--   Note that this function waits for all pending subscription change
--   requests, so if you for example call addChannelsAndWait from
--   multiple threads simultaneously, they all will wait for all pending
--   subscription changes to be acknowledged by Redis (this is due to the
--   fact that we just track the total number of pending change requests
--   sent to Redis and just wait until that count reaches zero).
--   
--   This also correctly waits if the network connection dies during the
--   subscription change. Say that the network connection dies right after
--   we send a subscription change to Redis. pubSubForever will
--   throw ConnectionLost and addChannelsAndWait will
--   continue to wait. Once you recall pubSubForever with the same
--   PubSubController, pubSubForever will open a new
--   connection, send subscription commands for all channels in the
--   PubSubController (which include the ones we are waiting for),
--   and wait for the responses from Redis. Only once we receive the
--   response from Redis that it has subscribed to all channels in
--   PubSubController will addChannelsAndWait unblock and
--   return.
addChannelsAndWait :: MonadIO m => PubSubController -> [(RedisChannel, MessageCallback)] -> [(RedisPChannel, PMessageCallback)] -> m UnregisterCallbacksAction

-- | Remove channels from the PubSubController, and if there is an
--   active pubSubForever, send the unsubscribe commands to Redis.
--   Note that as soon as this function returns, no more callbacks will be
--   executed even if more messages arrive during the period when we
--   request to unsubscribe from the channel and Redis actually processes
--   the unsubscribe request. This function is thread-safe.
--   
--   If you remove all channels, the connection in pubSubForever to
--   redis will stay open and waiting for any new channels from a call to
--   addChannels. If you really want to close the connection, use
--   killThread or cancel to kill the thread running
--   pubSubForever.
removeChannels :: MonadIO m => PubSubController -> [RedisChannel] -> [RedisPChannel] -> m ()

-- | Call removeChannels and then wait for all pending subscription
--   change requests to be acknowledged by Redis. This uses the same
--   waiting logic as addChannelsAndWait. Since
--   removeChannels immediately notifies the PubSubController
--   to start discarding messages, you likely don't need this function and
--   can just use removeChannels.
removeChannelsAndWait :: MonadIO m => PubSubController -> [RedisChannel] -> [RedisPChannel] -> m ()

-- | An action that when executed will unregister the callbacks. It is
--   returned from addChannels or addChannelsAndWait and
--   typically you would use it in bracket to guarantee that you
--   unsubscribe from channels. For example, if you are using websockets to
--   distribute messages to clients, you could use something such as:
--   
--   
--   websocketConn <- Network.WebSockets.acceptRequest pending
--   let mycallback msg = Network.WebSockets.sendTextData websocketConn msg
--   bracket (addChannelsAndWait ctrl [("hello", mycallback)] []) id $ const $ do
--     {- loop here calling Network.WebSockets.receiveData -}
--   
type UnregisterCallbacksAction = IO ()

-- | sendRequest can be used to implement commands from experimental
--   versions of Redis. An example of how to implement a command is given
--   below.
--   
--   
--   -- |Redis DEBUG OBJECT command
--   debugObject :: ByteString -> Redis (Either Reply ByteString)
--   debugObject key = sendRequest ["DEBUG", "OBJECT", key]
--   
sendRequest :: (RedisCtx m f, RedisResult a) => [ByteString] -> m (f a)

-- | Low-level representation of replies from the Redis server.
data Reply
SingleLine :: ByteString -> Reply
Error :: ByteString -> Reply
Integer :: Integer -> Reply
Bulk :: Maybe ByteString -> Reply
MultiBulk :: Maybe [Reply] -> Reply
data Status
Ok :: Status
Pong :: Status
Status :: ByteString -> Status
class RedisResult a
decode :: RedisResult a => Reply -> Either Reply a
data ConnectionLostException
ConnectionLost :: ConnectionLostException
newtype ConnectTimeout
ConnectTimeout :: ConnectPhase -> ConnectTimeout
data HashSlot

-- | Compute the hashslot associated with a key
keyToSlot :: ByteString -> HashSlot

-- | Database.Redis like interface with connection through Redis
--   Sentinel.
--   
--   More details here: https://redis.io/topics/sentinel.
--   
--   Example:
--   
--   
--   conn <- connect SentinelConnectionInfo (("localhost", PortNumber 26379) :| []) "mymaster" defaultConnectInfo
--   
--   runRedis conn $ do
--     set "hello" "world"
--   
--   
--   When connection is opened, the Sentinels will be queried to get
--   current master. Subsequent runRedis calls will talk to that
--   master.
--   
--   If runRedis call fails, the next call will choose a new master
--   to talk to.
--   
--   This implementation is based on Gist by Emanuel Borsboom at
--   https://gist.github.com/borsboom/681d37d273d5c4168723
module Database.Redis.Sentinel

-- | Configuration of Sentinel hosts.
data SentinelConnectInfo
SentinelConnectInfo :: NonEmpty (HostName, PortID) -> ByteString -> ConnectInfo -> SentinelConnectInfo

-- | List of sentinels.
[connectSentinels] :: SentinelConnectInfo -> NonEmpty (HostName, PortID)

-- | Name of master to connect to.
[connectMasterName] :: SentinelConnectInfo -> ByteString

-- | This is used to configure auth and other parameters for Redis
--   connection, but connectHost and connectPort are ignored.
[connectBaseInfo] :: SentinelConnectInfo -> ConnectInfo
data SentinelConnection
connect :: SentinelConnectInfo -> IO SentinelConnection

-- | Interact with a Redis datastore. See runRedis for details.
runRedis :: SentinelConnection -> Redis (Either Reply a) -> IO (Either Reply a)

-- | Exception thrown by Database.Redis.Sentinel.
data RedisSentinelException

-- | Thrown if no sentinel can be reached.
NoSentinels :: NonEmpty (HostName, PortID) -> RedisSentinelException
time :: RedisCtx m f => m (f (Integer, Integer))
class RedisResult a
decode :: RedisResult a => Reply -> Either Reply a
data RedisType
None :: RedisType
String :: RedisType
Hash :: RedisType
List :: RedisType
Set :: RedisType
ZSet :: RedisType

-- | Low-level representation of replies from the Redis server.
data Reply
SingleLine :: ByteString -> Reply
Error :: ByteString -> Reply
Integer :: Integer -> Reply
Bulk :: Maybe ByteString -> Reply
MultiBulk :: Maybe [Reply] -> Reply
wait :: RedisCtx m f => Integer -> Integer -> m (f Integer)

-- | Options for the sort command.
data SortOpts
SortOpts :: Maybe ByteString -> (Integer, Integer) -> [ByteString] -> SortOrder -> Bool -> SortOpts
[sortBy] :: SortOpts -> Maybe ByteString
[sortLimit] :: SortOpts -> (Integer, Integer)
[sortGet] :: SortOpts -> [ByteString]
[sortOrder] :: SortOpts -> SortOrder
[sortAlpha] :: SortOpts -> Bool
get :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
data Aggregate
Sum :: Aggregate
Min :: Aggregate
Max :: Aggregate
sort :: RedisCtx m f => ByteString -> SortOpts -> m (f [ByteString])
migrate :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Integer -> Integer -> m (f Status)
append :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
bitcount :: RedisCtx m f => ByteString -> m (f Integer)
keys :: RedisCtx m f => ByteString -> m (f [ByteString])
select :: RedisCtx m f => Integer -> m (f Status)
data PortID
PortNumber :: PortNumber -> PortID
UnixSocket :: String -> PortID
data Message
Message :: ByteString -> ByteString -> Message
[msgChannel] :: Message -> ByteString
[msgMessage] :: Message -> ByteString
PMessage :: ByteString -> ByteString -> ByteString -> Message
[msgPattern] :: Message -> ByteString
[msgChannel] :: Message -> ByteString
[msgMessage] :: Message -> ByteString
data Status
Ok :: Status
Pong :: Status
Status :: ByteString -> Status
scan :: RedisCtx m f => Cursor -> m (f (Cursor, [ByteString]))
data XReadResponse
XReadResponse :: ByteString -> [StreamsRecord] -> XReadResponse
[stream] :: XReadResponse -> ByteString
[records] :: XReadResponse -> [StreamsRecord]
rename :: RedisCtx m f => ByteString -> ByteString -> m (f Status)

-- | Context for normal command execution, outside of transactions. Use
--   runRedis to run actions of this type.
--   
--   In this context, each result is wrapped in an Either to account
--   for the possibility of Redis returning an Error reply.
data Redis a

-- | Deconstruct Redis constructor.
--   
--   unRedis and reRedis can be used to define instances for
--   arbitrary typeclasses.
--   
--   WARNING! These functions are considered internal and no guarantee is
--   given at this point that they will not break in future.
unRedis :: Redis a -> ReaderT RedisEnv IO a

-- | Reconstruct Redis constructor.
reRedis :: ReaderT RedisEnv IO a -> Redis a

-- | This class captures the following behaviour: In a context m,
--   a command will return its result wrapped in a "container" of type
--   f.
--   
--   Please refer to the Command Type Signatures section of this page for
--   more information.
class MonadRedis m => RedisCtx (m :: Type -> Type) (f :: Type -> Type) | m -> f
returnDecode :: (RedisCtx m f, RedisResult a) => Reply -> m (f a)
class Monad m => MonadRedis (m :: Type -> Type)
liftRedis :: MonadRedis m => Redis a -> m a
data ConnectError
ConnectAuthError :: Reply -> ConnectError
ConnectSelectError :: Reply -> ConnectError

-- | Constructs a Connection pool to a Redis server designated by
--   the given ConnectInfo, then tests if the server is actually
--   there. Throws an exception if the connection to the Redis server can't
--   be established.
checkedConnect :: ConnectInfo -> IO Connection

-- | Destroy all idle resources in the pool.
disconnect :: Connection -> IO ()

-- | Memory bracket around connect and disconnect.
withConnect :: (MonadMask m, MonadIO m) => ConnectInfo -> (Connection -> m c) -> m c

-- | Memory bracket around checkedConnect and disconnect
withCheckedConnect :: ConnectInfo -> (Connection -> IO c) -> IO c

-- | Information for connnecting to a Redis server.
--   
--   It is recommended to not use the ConnInfo data constructor
--   directly. Instead use defaultConnectInfo 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:
--   
--   
--   myConnectInfo :: ConnectInfo
--   myConnectInfo = defaultConnectInfo {connectAuth = Just "secret"}
--   
data ConnectInfo
ConnInfo :: HostName -> PortID -> Maybe ByteString -> Integer -> Int -> NominalDiffTime -> Maybe NominalDiffTime -> Maybe ClientParams -> ConnectInfo

-- | Ignored when connectPort is a UnixSocket
[connectHost] :: ConnectInfo -> HostName
[connectPort] :: ConnectInfo -> PortID

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

-- | Each connection will select 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 timeout
--   value in your redis.conf file is non-zero, it should be larger than
--   connectMaxIdleTime.
[connectMaxIdleTime] :: ConnectInfo -> NominalDiffTime

-- | Optional timeout until connection to Redis gets established.
--   ConnectTimeoutException 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

-- | Default information for connecting:
--   
--   
--   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
--   
defaultConnectInfo :: ConnectInfo

-- | Parse a ConnectInfo from a URL
--   
--   Username is ignored, path is used to specify the database:
--   
--   
--   >>> parseConnectInfo "redis://username:password@host:42/2"
--   Right (ConnInfo {connectHost = "host", connectPort = PortNumber 42, connectAuth = Just "password", connectDatabase = 2, connectMaxConnections = 50, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Nothing})
--   
--   
--   
--   >>> parseConnectInfo "redis://username:password@host:42/db"
--   Left "Invalid port: db"
--   
--   
--   The scheme is validated, to prevent mixing up configurations:
--   
--   
--   >>> parseConnectInfo "postgres://"
--   Left "Wrong scheme"
--   
--   
--   Beyond that, all values are optional. Omitted values are taken from
--   defaultConnectInfo:
--   
--   
--   >>> parseConnectInfo "redis://"
--   Right (ConnInfo {connectHost = "localhost", connectPort = PortNumber 6379, connectAuth = Nothing, connectDatabase = 0, connectMaxConnections = 50, connectMaxIdleTime = 30s, connectTimeout = Nothing, connectTLSParams = Nothing})
--   
parseConnectInfo :: String -> Either String ConnectInfo

-- | Constructs a ShardMap of connections to clustered nodes. The
--   argument is a ConnectInfo for any node in the cluster
--   
--   Some Redis commands are currently not supported in cluster mode -
--   CONFIG, AUTH - SCAN - MOVE, SELECT - PUBLISH, SUBSCRIBE, PSUBSCRIBE,
--   UNSUBSCRIBE, PUNSUBSCRIBE, RESET
connectCluster :: ConnectInfo -> IO Connection

-- | Encapsulates subscription changes. Use subscribe,
--   unsubscribe, psubscribe, punsubscribe or
--   mempty to construct a value. Combine values by using the
--   Monoid interface, i.e. mappend and mconcat.
data PubSub

-- | sendRequest can be used to implement commands from experimental
--   versions of Redis. An example of how to implement a command is given
--   below.
--   
--   
--   -- |Redis DEBUG OBJECT command
--   debugObject :: ByteString -> Redis (Either Reply ByteString)
--   debugObject key = sendRequest ["DEBUG", "OBJECT", key]
--   
sendRequest :: (RedisCtx m f, RedisResult a) => [ByteString] -> m (f a)
data ConnectionLostException
ConnectionLost :: ConnectionLostException
newtype ConnectTimeout
ConnectTimeout :: ConnectPhase -> ConnectTimeout
data HashSlot

-- | Compute the hashslot associated with a key
keyToSlot :: ByteString -> HashSlot
ping :: RedisCtx m f => m (f Status)
auth :: RedisCtx m f => ByteString -> m (f Status)
clusterSlots :: RedisCtx m f => m (f ClusterSlotsResponse)
command :: RedisCtx m f => m (f [CommandInfo])
data ClusterSlotsResponse
ClusterSlotsResponse :: [ClusterSlotsResponseEntry] -> ClusterSlotsResponse
[clusterSlotsResponseEntries] :: ClusterSlotsResponse -> [ClusterSlotsResponseEntry]
data ClusterSlotsResponseEntry
ClusterSlotsResponseEntry :: Int -> Int -> ClusterSlotsNode -> [ClusterSlotsNode] -> ClusterSlotsResponseEntry
[clusterSlotsResponseEntryStartSlot] :: ClusterSlotsResponseEntry -> Int
[clusterSlotsResponseEntryEndSlot] :: ClusterSlotsResponseEntry -> Int
[clusterSlotsResponseEntryMaster] :: ClusterSlotsResponseEntry -> ClusterSlotsNode
[clusterSlotsResponseEntryReplicas] :: ClusterSlotsResponseEntry -> [ClusterSlotsNode]
data ClusterSlotsNode
ClusterSlotsNode :: ByteString -> Int -> ByteString -> ClusterSlotsNode
[clusterSlotsNodeIP] :: ClusterSlotsNode -> ByteString
[clusterSlotsNodePort] :: ClusterSlotsNode -> Int
[clusterSlotsNodeID] :: ClusterSlotsNode -> ByteString

-- | Post a message to a channel (http://redis.io/commands/publish).
publish :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)

-- | Listens to published messages on subscribed channels and channels
--   matching the subscribed patterns. For documentation on the semantics
--   of Redis Pub/Sub see http://redis.io/topics/pubsub.
--   
--   The given callback function is called for each received message.
--   Subscription changes are triggered by the returned PubSub. To
--   keep subscriptions unchanged, the callback can return mempty.
--   
--   Example: Subscribe to the "news" channel indefinitely.
--   
--   
--   pubSub (subscribe ["news"]) $ \msg -> do
--       putStrLn $ "Message from " ++ show (msgChannel msg)
--       return mempty
--   
--   
--   
--   Example: Receive a single message from the "chat" channel.
--   
--   
--   pubSub (subscribe ["chat"]) $ \msg -> do
--       putStrLn $ "Message from " ++ show (msgChannel msg)
--       return $ unsubscribe ["chat"]
--   
--   
--   
--   It should be noted that Redis Pub/Sub by its nature is asynchronous so
--   returning unsubscribe does not mean that callback won't be able
--   to receive any further messages. And to guarantee that you won't won't
--   process messages after unsubscription and won't unsubscribe from the
--   same channel more than once you need to use IORef or
--   something similar
pubSub :: PubSub -> (Message -> IO PubSub) -> Redis ()

-- | Listen for messages published to the given channels
--   (http://redis.io/commands/subscribe).
subscribe :: [ByteString] -> PubSub

-- | Stop listening for messages posted to the given channels
--   (http://redis.io/commands/unsubscribe).
unsubscribe :: [ByteString] -> PubSub

-- | Listen for messages published to channels matching the given patterns
--   (http://redis.io/commands/psubscribe).
psubscribe :: [ByteString] -> PubSub

-- | Stop listening for messages posted to channels matching the given
--   patterns (http://redis.io/commands/punsubscribe).
punsubscribe :: [ByteString] -> PubSub

-- | Open a connection to the Redis server, register to all channels in the
--   PubSubController, and process messages and subscription change
--   requests forever. The only way this will ever exit is if there is an
--   exception from the network code or an unhandled exception in a
--   MessageCallback or PMessageCallback. For example, if the
--   network connection to Redis dies, pubSubForever will throw a
--   ConnectionLost. When such an exception is thrown, you can
--   recall pubSubForever with the same PubSubController
--   which will open a new connection and resubscribe to all the channels
--   which are tracked in the PubSubController.
--   
--   The general pattern is therefore during program startup create a
--   PubSubController and fork a thread which calls
--   pubSubForever in a loop (using an exponential backoff algorithm
--   such as the retry package to not hammer the Redis server if it
--   does die). For example,
--   
--   
--   myhandler :: ByteString -> IO ()
--   myhandler msg = putStrLn $ unpack $ decodeUtf8 msg
--   
--   onInitialComplete :: IO ()
--   onInitialComplete = putStrLn "Redis acknowledged that mychannel is now subscribed"
--   
--   main :: IO ()
--   main = do
--     conn <- connect defaultConnectInfo
--     pubSubCtrl <- newPubSubController [("mychannel", myhandler)] []
--     concurrently ( forever $
--         pubSubForever conn pubSubCtrl onInitialComplete
--           `catch` (\(e :: SomeException) -> do
--             putStrLn $ "Got error: " ++ show e
--             threadDelay $ 50*1000) -- TODO: use exponential backoff
--          ) $ restOfYourProgram
--   
--   
--     {- elsewhere in your program, use pubSubCtrl to change subscriptions -}
--   
--   
--   At most one active pubSubForever can be running against a
--   single PubSubController at any time. If two active calls to
--   pubSubForever share a single PubSubController there will
--   be deadlocks. If you do want to process messages using multiple
--   connections to Redis, you can create more than one
--   PubSubController. For example, create one PubSubController for
--   each getNumCapabilities and then create a Haskell thread bound
--   to each capability each calling pubSubForever in a loop. This
--   will create one network connection per controller/capability and allow
--   you to register separate channels and callbacks for each controller,
--   spreading the load across the capabilities.
pubSubForever :: Connection -> PubSubController -> IO () -> IO ()

-- | A Redis channel name
type RedisChannel = ByteString

-- | A Redis pattern channel name
type RedisPChannel = ByteString

-- | A handler for a message from a subscribed channel. The callback is
--   passed the message content.
--   
--   Messages are processed synchronously in the receiving thread, so if
--   the callback takes a long time it will block other callbacks and other
--   messages from being received. If you need to move long-running work to
--   a different thread, we suggest you use TBQueue with a
--   reasonable bound, so that if messages are arriving faster than you can
--   process them, you do eventually block.
--   
--   If the callback throws an exception, the exception will be thrown from
--   pubSubForever which will cause the entire Redis connection for
--   all subscriptions to be closed. As long as you call
--   pubSubForever in a loop you will reconnect to your subscribed
--   channels, but you should probably add an exception handler to each
--   callback to prevent this.
type MessageCallback = ByteString -> IO ()

-- | A handler for a message from a psubscribed channel. The callback is
--   passed the channel the message was sent on plus the message content.
--   
--   Similar to MessageCallback, callbacks are executed
--   synchronously and any exceptions are rethrown from
--   pubSubForever.
type PMessageCallback = RedisChannel -> ByteString -> IO ()

-- | A controller that stores a set of channels, pattern channels, and
--   callbacks. It allows you to manage Pub/Sub subscriptions and pattern
--   subscriptions and alter them at any time throughout the life of your
--   program. You should typically create the controller at the start of
--   your program and then store it through the life of your program, using
--   addChannels and removeChannels to update the current
--   subscriptions.
data PubSubController

-- | Create a new PubSubController. Note that this does not
--   subscribe to any channels, it just creates the controller. The
--   subscriptions will happen once pubSubForever is called.
newPubSubController :: MonadIO m => [(RedisChannel, MessageCallback)] -> [(RedisPChannel, PMessageCallback)] -> m PubSubController

-- | Get the list of current channels in the PubSubController.
--   WARNING! This might not exactly reflect the subscribed channels in the
--   Redis server, because there is a delay between adding or removing a
--   channel in the PubSubController and when Redis receives and
--   processes the subscription change request.
currentChannels :: MonadIO m => PubSubController -> m [RedisChannel]

-- | Get the list of current pattern channels in the
--   PubSubController. WARNING! This might not exactly reflect the
--   subscribed channels in the Redis server, because there is a delay
--   between adding or removing a channel in the PubSubController
--   and when Redis receives and processes the subscription change request.
currentPChannels :: MonadIO m => PubSubController -> m [RedisPChannel]

-- | Add channels into the PubSubController, and if there is an
--   active pubSubForever, send the subscribe and psubscribe
--   commands to Redis. The addChannels function is thread-safe.
--   This function does not wait for Redis to acknowledge that the channels
--   have actually been subscribed; use addChannelsAndWait for that.
--   
--   You can subscribe to the same channel or pattern channel multiple
--   times; the PubSubController keeps a list of callbacks and
--   executes each callback in response to a message.
--   
--   The return value is an action UnregisterCallbacksAction which
--   will unregister the callbacks, which should typically used with
--   bracket.
addChannels :: MonadIO m => PubSubController -> [(RedisChannel, MessageCallback)] -> [(RedisPChannel, PMessageCallback)] -> m UnregisterCallbacksAction

-- | Call addChannels and then wait for Redis to acknowledge that
--   the channels are actually subscribed.
--   
--   Note that this function waits for all pending subscription change
--   requests, so if you for example call addChannelsAndWait from
--   multiple threads simultaneously, they all will wait for all pending
--   subscription changes to be acknowledged by Redis (this is due to the
--   fact that we just track the total number of pending change requests
--   sent to Redis and just wait until that count reaches zero).
--   
--   This also correctly waits if the network connection dies during the
--   subscription change. Say that the network connection dies right after
--   we send a subscription change to Redis. pubSubForever will
--   throw ConnectionLost and addChannelsAndWait will
--   continue to wait. Once you recall pubSubForever with the same
--   PubSubController, pubSubForever will open a new
--   connection, send subscription commands for all channels in the
--   PubSubController (which include the ones we are waiting for),
--   and wait for the responses from Redis. Only once we receive the
--   response from Redis that it has subscribed to all channels in
--   PubSubController will addChannelsAndWait unblock and
--   return.
addChannelsAndWait :: MonadIO m => PubSubController -> [(RedisChannel, MessageCallback)] -> [(RedisPChannel, PMessageCallback)] -> m UnregisterCallbacksAction

-- | Remove channels from the PubSubController, and if there is an
--   active pubSubForever, send the unsubscribe commands to Redis.
--   Note that as soon as this function returns, no more callbacks will be
--   executed even if more messages arrive during the period when we
--   request to unsubscribe from the channel and Redis actually processes
--   the unsubscribe request. This function is thread-safe.
--   
--   If you remove all channels, the connection in pubSubForever to
--   redis will stay open and waiting for any new channels from a call to
--   addChannels. If you really want to close the connection, use
--   killThread or cancel to kill the thread running
--   pubSubForever.
removeChannels :: MonadIO m => PubSubController -> [RedisChannel] -> [RedisPChannel] -> m ()

-- | Call removeChannels and then wait for all pending subscription
--   change requests to be acknowledged by Redis. This uses the same
--   waiting logic as addChannelsAndWait. Since
--   removeChannels immediately notifies the PubSubController
--   to start discarding messages, you likely don't need this function and
--   can just use removeChannels.
removeChannelsAndWait :: MonadIO m => PubSubController -> [RedisChannel] -> [RedisPChannel] -> m ()

-- | An action that when executed will unregister the callbacks. It is
--   returned from addChannels or addChannelsAndWait and
--   typically you would use it in bracket to guarantee that you
--   unsubscribe from channels. For example, if you are using websockets to
--   distribute messages to clients, you could use something such as:
--   
--   
--   websocketConn <- Network.WebSockets.acceptRequest pending
--   let mycallback msg = Network.WebSockets.sendTextData websocketConn msg
--   bracket (addChannelsAndWait ctrl [("hello", mycallback)] []) id $ const $ do
--     {- loop here calling Network.WebSockets.receiveData -}
--   
type UnregisterCallbacksAction = IO ()

-- | Watch the given keys to determine execution of the MULTI/EXEC block
--   (http://redis.io/commands/watch).
watch :: [ByteString] -> Redis (Either Reply Status)

-- | Forget about all watched keys
--   (http://redis.io/commands/unwatch).
unwatch :: Redis (Either Reply Status)

-- | Run commands inside a transaction. For documentation on the semantics
--   of Redis transaction see http://redis.io/topics/transactions.
--   
--   Inside the transaction block, command functions return their result
--   wrapped in a Queued. The Queued result is a proxy object
--   for the actual command's result, which will only be available after
--   EXECing the transaction.
--   
--   Example usage (note how Queued 's Applicative instance
--   is used to combine the two individual results):
--   
--   
--   runRedis conn $ do
--       set "hello" "hello"
--       set "world" "world"
--       helloworld <- multiExec $ do
--           hello <- get "hello"
--           world <- get "world"
--           return $ (,) <$> hello <*> world
--       liftIO (print helloworld)
--   
--   
multiExec :: RedisTx (Queued a) -> Redis (TxResult a)

-- | A Queued value represents the result of a command inside a
--   transaction. It is a proxy object for the actual result, which
--   will only be available after returning from a multiExec
--   transaction.
--   
--   Queued values are composable by utilizing the Functor,
--   Applicative or Monad interfaces.
data Queued a

-- | Result of a multiExec transaction.
data TxResult a

-- | Transaction completed successfully. The wrapped value corresponds to
--   the Queued value returned from the multiExec argument
--   action.
TxSuccess :: a -> TxResult a

-- | Transaction aborted due to an earlier watch command.
TxAborted :: TxResult a

-- | At least one of the commands returned an Error reply.
TxError :: String -> TxResult a

-- | Command-context inside of MULTI/EXEC transactions. Use
--   multiExec to run actions of this type.
--   
--   In the RedisTx context, all commands return a Queued
--   value. It is a proxy object for the actual result, which will
--   only be available after finishing the transaction.
data RedisTx a
echo :: RedisCtx m f => ByteString -> m (f ByteString)
quit :: RedisCtx m f => m (f Status)
del :: RedisCtx m f => [ByteString] -> m (f Integer)
dump :: RedisCtx m f => ByteString -> m (f ByteString)
exists :: RedisCtx m f => ByteString -> m (f Bool)
expire :: RedisCtx m f => ByteString -> Integer -> m (f Bool)
expireat :: RedisCtx m f => ByteString -> Integer -> m (f Bool)

-- | Options for the migrate command.
data MigrateOpts
MigrateOpts :: Bool -> Bool -> MigrateOpts
[migrateCopy] :: MigrateOpts -> Bool
[migrateReplace] :: MigrateOpts -> Bool

-- | Redis default MigrateOpts. Equivalent to omitting all optional
--   parameters.
--   
--   
--   MigrateOpts
--       { migrateCopy    = False -- remove the key from the local instance
--       , migrateReplace = False -- don't replace existing key on the remote instance
--       }
--   
defaultMigrateOpts :: MigrateOpts
migrateMultiple :: RedisCtx m f => ByteString -> ByteString -> Integer -> Integer -> MigrateOpts -> [ByteString] -> m (f Status)
move :: RedisCtx m f => ByteString -> Integer -> m (f Bool)
objectRefcount :: RedisCtx m f => ByteString -> m (f Integer)
objectEncoding :: RedisCtx m f => ByteString -> m (f ByteString)
objectIdletime :: RedisCtx m f => ByteString -> m (f Integer)
persist :: RedisCtx m f => ByteString -> m (f Bool)
pexpire :: RedisCtx m f => ByteString -> Integer -> m (f Bool)
pexpireat :: RedisCtx m f => ByteString -> Integer -> m (f Bool)
pttl :: RedisCtx m f => ByteString -> m (f Integer)
randomkey :: RedisCtx m f => m (f (Maybe ByteString))
renamenx :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
restore :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
restoreReplace :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
data Cursor
cursor0 :: Cursor
data ScanOpts
ScanOpts :: Maybe ByteString -> Maybe Integer -> ScanOpts
[scanMatch] :: ScanOpts -> Maybe ByteString
[scanCount] :: ScanOpts -> Maybe Integer

-- | Redis default ScanOpts. Equivalent to omitting all optional
--   parameters.
--   
--   
--   ScanOpts
--       { scanMatch = Nothing -- don't match any pattern
--       , scanCount = Nothing -- don't set any requirements on number elements returned (works like value COUNT 10)
--       }
--   
defaultScanOpts :: ScanOpts
scanOpts :: RedisCtx m f => Cursor -> ScanOpts -> m (f (Cursor, [ByteString]))

-- | Redis default SortOpts. Equivalent to omitting all optional
--   parameters.
--   
--   
--   SortOpts
--       { sortBy    = Nothing -- omit the BY option
--       , sortLimit = (0,-1)  -- return entire collection
--       , sortGet   = []      -- omit the GET option
--       , sortOrder = Asc     -- sort in ascending order
--       , sortAlpha = False   -- sort numerically, not lexicographically
--       }
--   
defaultSortOpts :: SortOpts
data SortOrder
Asc :: SortOrder
Desc :: SortOrder
sortStore :: RedisCtx m f => ByteString -> ByteString -> SortOpts -> m (f Integer)
ttl :: RedisCtx m f => ByteString -> m (f Integer)
getType :: RedisCtx m f => ByteString -> m (f RedisType)
hdel :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
hexists :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
hget :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe ByteString))
hgetall :: RedisCtx m f => ByteString -> m (f [(ByteString, ByteString)])
hincrby :: RedisCtx m f => ByteString -> ByteString -> Integer -> m (f Integer)
hincrbyfloat :: RedisCtx m f => ByteString -> ByteString -> Double -> m (f Double)
hkeys :: RedisCtx m f => ByteString -> m (f [ByteString])
hlen :: RedisCtx m f => ByteString -> m (f Integer)
hmget :: RedisCtx m f => ByteString -> [ByteString] -> m (f [Maybe ByteString])
hmset :: RedisCtx m f => ByteString -> [(ByteString, ByteString)] -> m (f Status)
hscan :: RedisCtx m f => ByteString -> Cursor -> m (f (Cursor, [(ByteString, ByteString)]))
hscanOpts :: RedisCtx m f => ByteString -> Cursor -> ScanOpts -> m (f (Cursor, [(ByteString, ByteString)]))
hset :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
hsetnx :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Bool)
hstrlen :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
hvals :: RedisCtx m f => ByteString -> m (f [ByteString])
pfadd :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
pfcount :: RedisCtx m f => [ByteString] -> m (f Integer)
pfmerge :: RedisCtx m f => ByteString -> [ByteString] -> m (f ByteString)
blpop :: RedisCtx m f => [ByteString] -> Integer -> m (f (Maybe (ByteString, ByteString)))
brpop :: RedisCtx m f => [ByteString] -> Integer -> m (f (Maybe (ByteString, ByteString)))
brpoplpush :: RedisCtx m f => ByteString -> ByteString -> Integer -> m (f (Maybe ByteString))
lindex :: RedisCtx m f => ByteString -> Integer -> m (f (Maybe ByteString))
linsertBefore :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
linsertAfter :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
llen :: RedisCtx m f => ByteString -> m (f Integer)
lpop :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
lpush :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
lpushx :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
lrange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [ByteString])
lrem :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Integer)
lset :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
ltrim :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f Status)
rpop :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
rpoplpush :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe ByteString))
rpush :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
rpushx :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
eval :: (RedisCtx m f, RedisResult a) => ByteString -> [ByteString] -> [ByteString] -> m (f a)

-- | Works like eval, but sends the SHA1 hash of the script instead
--   of the script itself. Fails if the server does not recognise the hash,
--   in which case, eval should be used instead.
evalsha :: (RedisCtx m f, RedisResult a) => ByteString -> [ByteString] -> [ByteString] -> m (f a)
data DebugMode
scriptDebug :: RedisCtx m f => DebugMode -> m (f Bool)
scriptExists :: RedisCtx m f => [ByteString] -> m (f [Bool])
scriptFlush :: RedisCtx m f => m (f Status)
scriptKill :: RedisCtx m f => m (f Status)
scriptLoad :: RedisCtx m f => ByteString -> m (f ByteString)
bgrewriteaof :: RedisCtx m f => m (f Status)
bgsave :: RedisCtx m f => m (f Status)
clientGetname :: RedisCtx m f => m (f Status)
clientList :: RedisCtx m f => m (f [ByteString])
clientPause :: RedisCtx m f => Integer -> m (f Status)
data ReplyMode
clientReply :: RedisCtx m f => ReplyMode -> m (f Bool)
clientSetname :: RedisCtx m f => ByteString -> m (f ByteString)
commandCount :: RedisCtx m f => m (f Integer)
commandInfo :: RedisCtx m f => [ByteString] -> m (f [ByteString])
configGet :: RedisCtx m f => ByteString -> m (f [(ByteString, ByteString)])
configResetstat :: RedisCtx m f => m (f Status)
configRewrite :: RedisCtx m f => m (f Status)
configSet :: RedisCtx m f => ByteString -> ByteString -> m (f Status)
dbsize :: RedisCtx m f => m (f Integer)
debugObject :: RedisCtx m f => ByteString -> m (f ByteString)
flushall :: RedisCtx m f => m (f Status)
flushdb :: RedisCtx m f => m (f Status)
info :: RedisCtx m f => m (f ByteString)
infoSection :: RedisCtx m f => ByteString -> m (f ByteString)
lastsave :: RedisCtx m f => m (f Integer)
save :: RedisCtx m f => m (f Status)
slaveof :: RedisCtx m f => ByteString -> ByteString -> m (f Status)

-- | A single entry from the slowlog.
data Slowlog
Slowlog :: Integer -> Integer -> Integer -> [ByteString] -> Maybe ByteString -> Maybe ByteString -> Slowlog

-- | A unique progressive identifier for every slow log entry.
[slowlogId] :: Slowlog -> Integer

-- | The unix timestamp at which the logged command was processed.
[slowlogTimestamp] :: Slowlog -> Integer

-- | The amount of time needed for its execution, in microseconds.
[slowlogMicros] :: Slowlog -> Integer

-- | The command and it's arguments.
[slowlogCmd] :: Slowlog -> [ByteString]
[slowlogClientIpAndPort] :: Slowlog -> Maybe ByteString
[slowlogClientName] :: Slowlog -> Maybe ByteString
slowlogGet :: RedisCtx m f => Integer -> m (f [Slowlog])
slowlogLen :: RedisCtx m f => m (f Integer)
slowlogReset :: RedisCtx m f => m (f Status)
sadd :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
scard :: RedisCtx m f => ByteString -> m (f Integer)
sdiff :: RedisCtx m f => [ByteString] -> m (f [ByteString])
sdiffstore :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
sinter :: RedisCtx m f => [ByteString] -> m (f [ByteString])
sinterstore :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
sismember :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
smembers :: RedisCtx m f => ByteString -> m (f [ByteString])
smove :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Bool)
spop :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
spopN :: RedisCtx m f => ByteString -> Integer -> m (f [ByteString])
srandmember :: RedisCtx m f => ByteString -> m (f (Maybe ByteString))
srandmemberN :: RedisCtx m f => ByteString -> Integer -> m (f [ByteString])
srem :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
sscan :: RedisCtx m f => ByteString -> Cursor -> m (f (Cursor, [ByteString]))
sscanOpts :: RedisCtx m f => ByteString -> Cursor -> ScanOpts -> m (f (Cursor, [ByteString]))
sunion :: RedisCtx m f => [ByteString] -> m (f [ByteString])
sunionstore :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
data ZaddOpts
ZaddOpts :: Maybe Condition -> Bool -> Bool -> ZaddOpts
[zaddCondition] :: ZaddOpts -> Maybe Condition
[zaddChange] :: ZaddOpts -> Bool
[zaddIncrement] :: ZaddOpts -> Bool

-- | Redis default ZaddOpts. Equivalent to omitting all optional
--   parameters.
--   
--   
--   ZaddOpts
--       { zaddCondition = Nothing -- omit NX and XX options
--       , zaddChange    = False   -- don't modify the return value from the number of new elements added, to the total number of elements changed
--       , zaddIncrement = False   -- don't add like ZINCRBY
--       }
--   
defaultZaddOpts :: ZaddOpts
zadd :: RedisCtx m f => ByteString -> [(Double, ByteString)] -> m (f Integer)
zaddOpts :: RedisCtx m f => ByteString -> [(Double, ByteString)] -> ZaddOpts -> m (f Integer)
zcard :: RedisCtx m f => ByteString -> m (f Integer)
zcount :: RedisCtx m f => ByteString -> Double -> Double -> m (f Integer)
zincrby :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Double)
zinterstore :: RedisCtx m f => ByteString -> [ByteString] -> Aggregate -> m (f Integer)
zinterstoreWeights :: RedisCtx m f => ByteString -> [(ByteString, Double)] -> Aggregate -> m (f Integer)
zlexcount :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
zrange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [ByteString])
zrangeWithscores :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [(ByteString, Double)])
data RangeLex a
Incl :: a -> RangeLex a
Excl :: a -> RangeLex a
Minr :: RangeLex a
Maxr :: RangeLex a
zrangebylex :: RedisCtx m f => ByteString -> RangeLex ByteString -> RangeLex ByteString -> m (f [ByteString])
zrangebylexLimit :: RedisCtx m f => ByteString -> RangeLex ByteString -> RangeLex ByteString -> Integer -> Integer -> m (f [ByteString])
zrangebyscore :: RedisCtx m f => ByteString -> Double -> Double -> m (f [ByteString])
zrangebyscoreWithscores :: RedisCtx m f => ByteString -> Double -> Double -> m (f [(ByteString, Double)])
zrangebyscoreLimit :: RedisCtx m f => ByteString -> Double -> Double -> Integer -> Integer -> m (f [ByteString])
zrangebyscoreWithscoresLimit :: RedisCtx m f => ByteString -> Double -> Double -> Integer -> Integer -> m (f [(ByteString, Double)])
zrank :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe Integer))
zrem :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
zremrangebylex :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
zremrangebyrank :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f Integer)
zremrangebyscore :: RedisCtx m f => ByteString -> Double -> Double -> m (f Integer)
zrevrange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [ByteString])
zrevrangeWithscores :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f [(ByteString, Double)])
zrevrangebyscore :: RedisCtx m f => ByteString -> Double -> Double -> m (f [ByteString])
zrevrangebyscoreWithscores :: RedisCtx m f => ByteString -> Double -> Double -> m (f [(ByteString, Double)])
zrevrangebyscoreLimit :: RedisCtx m f => ByteString -> Double -> Double -> Integer -> Integer -> m (f [ByteString])
zrevrangebyscoreWithscoresLimit :: RedisCtx m f => ByteString -> Double -> Double -> Integer -> Integer -> m (f [(ByteString, Double)])
zrevrank :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe Integer))
zscan :: RedisCtx m f => ByteString -> Cursor -> m (f (Cursor, [(ByteString, Double)]))
zscanOpts :: RedisCtx m f => ByteString -> Cursor -> ScanOpts -> m (f (Cursor, [(ByteString, Double)]))
zscore :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe Double))
zunionstore :: RedisCtx m f => ByteString -> [ByteString] -> Aggregate -> m (f Integer)
zunionstoreWeights :: RedisCtx m f => ByteString -> [(ByteString, Double)] -> Aggregate -> m (f Integer)
bitcountRange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f Integer)
bitopAnd :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
bitopOr :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
bitopXor :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
bitopNot :: RedisCtx m f => ByteString -> ByteString -> m (f Integer)
bitpos :: RedisCtx m f => ByteString -> Integer -> Integer -> Integer -> m (f Integer)
decr :: RedisCtx m f => ByteString -> m (f Integer)
decrby :: RedisCtx m f => ByteString -> Integer -> m (f Integer)
getbit :: RedisCtx m f => ByteString -> Integer -> m (f Integer)
getrange :: RedisCtx m f => ByteString -> Integer -> Integer -> m (f ByteString)
getset :: RedisCtx m f => ByteString -> ByteString -> m (f (Maybe ByteString))
incr :: RedisCtx m f => ByteString -> m (f Integer)
incrby :: RedisCtx m f => ByteString -> Integer -> m (f Integer)
incrbyfloat :: RedisCtx m f => ByteString -> Double -> m (f Double)
mget :: RedisCtx m f => [ByteString] -> m (f [Maybe ByteString])
mset :: RedisCtx m f => [(ByteString, ByteString)] -> m (f Status)
msetnx :: RedisCtx m f => [(ByteString, ByteString)] -> m (f Bool)
psetex :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
data Condition
Nx :: Condition
Xx :: Condition
data SetOpts
SetOpts :: Maybe Integer -> Maybe Integer -> Maybe Condition -> SetOpts
[setSeconds] :: SetOpts -> Maybe Integer
[setMilliseconds] :: SetOpts -> Maybe Integer
[setCondition] :: SetOpts -> Maybe Condition
set :: RedisCtx m f => ByteString -> ByteString -> m (f Status)
setOpts :: RedisCtx m f => ByteString -> ByteString -> SetOpts -> m (f Status)
setbit :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Integer)
setex :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Status)
setnx :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
setrange :: RedisCtx m f => ByteString -> Integer -> ByteString -> m (f Integer)
strlen :: RedisCtx m f => ByteString -> m (f Integer)
data XReadOpts
XReadOpts :: Maybe Integer -> Maybe Integer -> XReadOpts
[block] :: XReadOpts -> Maybe Integer
[recordCount] :: XReadOpts -> Maybe Integer

-- | Redis default XReadOpts. Equivalent to omitting all optional
--   parameters.
--   
--   
--   XReadOpts
--       { block = Nothing -- Don't block waiting for more records
--       , recordCount    = Nothing   -- no record count
--       }
--   
defaultXreadOpts :: XReadOpts
data StreamsRecord
StreamsRecord :: ByteString -> [(ByteString, ByteString)] -> StreamsRecord
[recordId] :: StreamsRecord -> ByteString
[keyValues] :: StreamsRecord -> [(ByteString, ByteString)]
data TrimOpts
NoArgs :: TrimOpts
Maxlen :: Integer -> TrimOpts
ApproxMaxlen :: Integer -> TrimOpts
xadd :: RedisCtx m f => ByteString -> ByteString -> [(ByteString, ByteString)] -> m (f ByteString)
xaddOpts :: RedisCtx m f => ByteString -> ByteString -> [(ByteString, ByteString)] -> TrimOpts -> m (f ByteString)
xread :: RedisCtx m f => [(ByteString, ByteString)] -> m (f (Maybe [XReadResponse]))
xreadOpts :: RedisCtx m f => [(ByteString, ByteString)] -> XReadOpts -> m (f (Maybe [XReadResponse]))
xreadGroup :: RedisCtx m f => ByteString -> ByteString -> [(ByteString, ByteString)] -> m (f (Maybe [XReadResponse]))
xreadGroupOpts :: RedisCtx m f => ByteString -> ByteString -> [(ByteString, ByteString)] -> XReadOpts -> m (f (Maybe [XReadResponse]))
xack :: RedisCtx m f => ByteString -> ByteString -> [ByteString] -> m (f Integer)
xgroupCreate :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Status)
xgroupSetId :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Status)
xgroupDestroy :: RedisCtx m f => ByteString -> ByteString -> m (f Bool)
xgroupDelConsumer :: RedisCtx m f => ByteString -> ByteString -> ByteString -> m (f Integer)
xrange :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Maybe Integer -> m (f [StreamsRecord])
xrevRange :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Maybe Integer -> m (f [StreamsRecord])
xlen :: RedisCtx m f => ByteString -> m (f Integer)
data XPendingSummaryResponse
XPendingSummaryResponse :: Integer -> ByteString -> ByteString -> [(ByteString, Integer)] -> XPendingSummaryResponse
[numPendingMessages] :: XPendingSummaryResponse -> Integer
[smallestPendingMessageId] :: XPendingSummaryResponse -> ByteString
[largestPendingMessageId] :: XPendingSummaryResponse -> ByteString
[numPendingMessagesByconsumer] :: XPendingSummaryResponse -> [(ByteString, Integer)]
xpendingSummary :: RedisCtx m f => ByteString -> ByteString -> Maybe ByteString -> m (f XPendingSummaryResponse)
data XPendingDetailRecord
XPendingDetailRecord :: ByteString -> ByteString -> Integer -> Integer -> XPendingDetailRecord
[messageId] :: XPendingDetailRecord -> ByteString
[consumer] :: XPendingDetailRecord -> ByteString
[millisSinceLastDelivered] :: XPendingDetailRecord -> Integer
[numTimesDelivered] :: XPendingDetailRecord -> Integer
xpendingDetail :: RedisCtx m f => ByteString -> ByteString -> ByteString -> ByteString -> Integer -> Maybe ByteString -> m (f [XPendingDetailRecord])
data XClaimOpts
XClaimOpts :: Maybe Integer -> Maybe Integer -> Maybe Integer -> Bool -> XClaimOpts
[xclaimIdle] :: XClaimOpts -> Maybe Integer
[xclaimTime] :: XClaimOpts -> Maybe Integer
[xclaimRetryCount] :: XClaimOpts -> Maybe Integer
[xclaimForce] :: XClaimOpts -> Bool
defaultXClaimOpts :: XClaimOpts
xclaim :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Integer -> XClaimOpts -> [ByteString] -> m (f [StreamsRecord])
xclaimJustIds :: RedisCtx m f => ByteString -> ByteString -> ByteString -> Integer -> XClaimOpts -> [ByteString] -> m (f [ByteString])
data XInfoConsumersResponse
XInfoConsumersResponse :: ByteString -> Integer -> Integer -> XInfoConsumersResponse
[xinfoConsumerName] :: XInfoConsumersResponse -> ByteString
[xinfoConsumerNumPendingMessages] :: XInfoConsumersResponse -> Integer
[xinfoConsumerIdleTime] :: XInfoConsumersResponse -> Integer
xinfoConsumers :: RedisCtx m f => ByteString -> ByteString -> m (f [XInfoConsumersResponse])
data XInfoGroupsResponse
XInfoGroupsResponse :: ByteString -> Integer -> Integer -> ByteString -> XInfoGroupsResponse
[xinfoGroupsGroupName] :: XInfoGroupsResponse -> ByteString
[xinfoGroupsNumConsumers] :: XInfoGroupsResponse -> Integer
[xinfoGroupsNumPendingMessages] :: XInfoGroupsResponse -> Integer
[xinfoGroupsLastDeliveredMessageId] :: XInfoGroupsResponse -> ByteString
xinfoGroups :: RedisCtx m f => ByteString -> m (f [XInfoGroupsResponse])
data XInfoStreamResponse
XInfoStreamResponse :: Integer -> Integer -> Integer -> Integer -> ByteString -> StreamsRecord -> StreamsRecord -> XInfoStreamResponse
[xinfoStreamLength] :: XInfoStreamResponse -> Integer
[xinfoStreamRadixTreeKeys] :: XInfoStreamResponse -> Integer
[xinfoStreamRadixTreeNodes] :: XInfoStreamResponse -> Integer
[xinfoStreamNumGroups] :: XInfoStreamResponse -> Integer
[xinfoStreamLastEntryId] :: XInfoStreamResponse -> ByteString
[xinfoStreamFirstEntry] :: XInfoStreamResponse -> StreamsRecord
[xinfoStreamLastEntry] :: XInfoStreamResponse -> StreamsRecord
XInfoStreamEmptyResponse :: Integer -> Integer -> Integer -> Integer -> ByteString -> XInfoStreamResponse
[xinfoStreamLength] :: XInfoStreamResponse -> Integer
[xinfoStreamRadixTreeKeys] :: XInfoStreamResponse -> Integer
[xinfoStreamRadixTreeNodes] :: XInfoStreamResponse -> Integer
[xinfoStreamNumGroups] :: XInfoStreamResponse -> Integer
[xinfoStreamLastEntryId] :: XInfoStreamResponse -> ByteString
xinfoStream :: RedisCtx m f => ByteString -> m (f XInfoStreamResponse)
xdel :: RedisCtx m f => ByteString -> [ByteString] -> m (f Integer)
xtrim :: RedisCtx m f => ByteString -> TrimOpts -> m (f Integer)
inf :: RealFloat a => a
data ClusterNodesResponse
ClusterNodesResponse :: [ClusterNodesResponseEntry] -> ClusterNodesResponse
[clusterNodesResponseEntries] :: ClusterNodesResponse -> [ClusterNodesResponseEntry]
data ClusterNodesResponseEntry
ClusterNodesResponseEntry :: ByteString -> ByteString -> Integer -> [ByteString] -> Maybe ByteString -> Integer -> Integer -> Integer -> ByteString -> [ClusterNodesResponseSlotSpec] -> ClusterNodesResponseEntry
[clusterNodesResponseNodeId] :: ClusterNodesResponseEntry -> ByteString
[clusterNodesResponseNodeIp] :: ClusterNodesResponseEntry -> ByteString
[clusterNodesResponseNodePort] :: ClusterNodesResponseEntry -> Integer
[clusterNodesResponseNodeFlags] :: ClusterNodesResponseEntry -> [ByteString]
[clusterNodesResponseMasterId] :: ClusterNodesResponseEntry -> Maybe ByteString
[clusterNodesResponsePingSent] :: ClusterNodesResponseEntry -> Integer
[clusterNodesResponsePongReceived] :: ClusterNodesResponseEntry -> Integer
[clusterNodesResponseConfigEpoch] :: ClusterNodesResponseEntry -> Integer
[clusterNodesResponseLinkState] :: ClusterNodesResponseEntry -> ByteString
[clusterNodesResponseSlots] :: ClusterNodesResponseEntry -> [ClusterNodesResponseSlotSpec]
data ClusterNodesResponseSlotSpec
ClusterNodesResponseSingleSlot :: Integer -> ClusterNodesResponseSlotSpec
ClusterNodesResponseSlotRange :: Integer -> Integer -> ClusterNodesResponseSlotSpec
ClusterNodesResponseSlotImporting :: Integer -> ByteString -> ClusterNodesResponseSlotSpec
ClusterNodesResponseSlotMigrating :: Integer -> ByteString -> ClusterNodesResponseSlotSpec
clusterNodes :: RedisCtx m f => m (f ClusterNodesResponse)
clusterSetSlotNode :: RedisCtx m f => Integer -> ByteString -> m (f Status)
clusterSetSlotStable :: RedisCtx m f => Integer -> m (f Status)
clusterSetSlotImporting :: RedisCtx m f => Integer -> ByteString -> m (f Status)
clusterSetSlotMigrating :: RedisCtx m f => Integer -> ByteString -> m (f Status)
clusterGetKeysInSlot :: RedisCtx m f => Integer -> Integer -> m (f [ByteString])
instance GHC.Internal.Exception.Type.Exception Database.Redis.Sentinel.RedisSentinelException
instance GHC.Internal.Show.Show Database.Redis.Sentinel.RedisSentinelException
instance GHC.Internal.Show.Show Database.Redis.Sentinel.SentinelConnectInfo
