module Database.Redis.List
( listRightPush, listRightPushB
, listLeftPush, listLeftPushB
, listLength, listLengthB
, listRange, listRangeB
, listIndex, listIndexB
, listRemove, listRemoveB
, listTrim
, listSet
, listHeadPop
, listTailPop
, listBlockHeadPop
, listBlockTailPop
, listRPopLPush
) where
import System.IO
import Database.Redis.Internal
listRightPush :: Handle
-> String
-> String
-> IO (Maybe RedisReply)
listRightPush h key value = request h $ map toUTF8 ["RPUSH", key, value]
listRightPushB :: Handle
-> ByteString
-> ByteString
-> IO (Maybe RedisReply)
listRightPushB h key value = request h [toUTF8 "RPUSH", key, value]
listLeftPush :: Handle
-> String
-> String
-> IO (Maybe RedisReply)
listLeftPush h key value = request h $ map toUTF8 ["LPUSH", key, value]
listLeftPushB :: Handle
-> ByteString
-> ByteString
-> IO (Maybe RedisReply)
listLeftPushB h key value = request h [toUTF8 "LPUSH", key, value]
listLength :: Handle
-> String
-> IO (Maybe RedisReply)
listLength h key = request h $ map toUTF8 ["LLEN", key]
listLengthB :: Handle
-> ByteString
-> IO (Maybe RedisReply)
listLengthB h key = request h [toUTF8 "LLEN", key]
listRange :: Handle
-> String
-> Int
-> Int
-> IO (Maybe RedisReply)
listRange h key start end =
request h $ map toUTF8 ["LRANGE", key, show start, show end]
listRangeB :: Handle
-> ByteString
-> Int
-> Int
-> IO (Maybe RedisReply)
listRangeB h key start end =
request h [toUTF8 "LRANGE", key, toUTF8 $ show start, toUTF8 $ show end]
listTrim :: Handle
-> String
-> Int
-> Int
-> IO (Maybe RedisReply)
listTrim h key start end =
request h $ map toUTF8 ["LTRIM", key, show start, show end]
listIndex :: Handle
-> String
-> Int
-> IO (Maybe RedisReply)
listIndex h key index =
request h $ map toUTF8 ["LINDEX", key, show index]
listIndexB :: Handle
-> ByteString
-> Int
-> IO (Maybe RedisReply)
listIndexB h key index =
request h [toUTF8 "LINDEX", key, toUTF8 $ show index]
listSet :: Handle
-> String
-> Int
-> String
-> IO (Maybe RedisReply)
listSet h key index value =
request h $ map toUTF8 ["LSET", key, show index, value]
listRemove :: Handle
-> String
-> Int
-> String
-> IO (Maybe RedisReply)
listRemove h key num value =
request h $ map toUTF8 ["LREM", key, show num, value]
listRemoveB :: Handle
-> ByteString
-> Int
-> ByteString
-> IO (Maybe RedisReply)
listRemoveB h key num value =
request h [toUTF8 "LREM", key, toUTF8 $ show num, value]
listHeadPop :: Handle
-> String
-> IO (Maybe RedisReply)
listHeadPop h key =
request h $ map toUTF8 ["LPOP", key]
listTailPop :: Handle
-> String
-> IO (Maybe RedisReply)
listTailPop h key =
request h $ map toUTF8 ["RPOP", key]
listBlockHeadPop :: Handle
-> String
-> IO (Maybe RedisReply)
listBlockHeadPop h key =
request h $ map toUTF8 ["BLPOP", key]
listBlockTailPop :: Handle
-> String
-> IO (Maybe RedisReply)
listBlockTailPop h key =
request h $ map toUTF8 ["BRPOP", key]
listRPopLPush :: Handle
-> String
-> String
-> IO (Maybe RedisReply)
listRPopLPush h source destination =
request h $ map toUTF8 ["RPOPLPUSH", source, destination]