Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Redis.Command
Synopsis
- type Redis = ProgramT Command
- type PubSub = ProgramT PubSubCommand
- data Command a where
- Ping :: Resp -> Command ()
- Echo :: forall a. FromByteString a => Resp -> Command a
- Auth :: Resp -> Command ()
- Quit :: Resp -> Command ()
- Select :: Resp -> Command ()
- BgRewriteAOF :: Resp -> Command ()
- BgSave :: Resp -> Command ()
- Save :: Resp -> Command ()
- DbSize :: Resp -> Command Int64
- FlushAll :: Resp -> Command ()
- FlushDb :: Resp -> Command ()
- LastSave :: Resp -> Command Int64
- Multi :: Resp -> Command ()
- Watch :: Resp -> Command ()
- Unwatch :: Resp -> Command ()
- Discard :: Resp -> Command ()
- Exec :: Resp -> Command ()
- Del :: Resp -> Command Int64
- Dump :: Resp -> Command (Maybe ByteString)
- Exists :: Resp -> Command Bool
- Expire :: Resp -> Command Bool
- ExpireAt :: Resp -> Command Bool
- Persist :: Resp -> Command Bool
- Keys :: Resp -> Command [Key]
- RandomKey :: Resp -> Command (Maybe Key)
- Rename :: Resp -> Command ()
- RenameNx :: Resp -> Command Bool
- Sort :: forall a1. FromByteString a1 => Resp -> Command [a1]
- Ttl :: Resp -> Command (Maybe TTL)
- Type :: Resp -> Command (Maybe RedisType)
- Scan :: forall a1. FromByteString a1 => Resp -> Command (Cursor, [a1])
- Append :: Resp -> Command Int64
- Get :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1)
- GetRange :: forall a. FromByteString a => Resp -> Command a
- GetSet :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1)
- MGet :: forall a1. FromByteString a1 => Resp -> Command [Maybe a1]
- MSet :: Resp -> Command ()
- MSetNx :: Resp -> Command Bool
- Set :: Resp -> Command Bool
- SetRange :: Resp -> Command Int64
- StrLen :: Resp -> Command Int64
- BitAnd :: Resp -> Command Int64
- BitCount :: Resp -> Command Int64
- BitNot :: Resp -> Command Int64
- BitOr :: Resp -> Command Int64
- BitPos :: Resp -> Command Int64
- BitXOr :: Resp -> Command Int64
- GetBit :: Resp -> Command Int64
- SetBit :: Resp -> Command Int64
- Decr :: Resp -> Command Int64
- DecrBy :: Resp -> Command Int64
- Incr :: Resp -> Command Int64
- IncrBy :: Resp -> Command Int64
- IncrByFloat :: Resp -> Command Double
- HDel :: Resp -> Command Int64
- HExists :: Resp -> Command Bool
- HGet :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1)
- HGetAll :: forall a1. FromByteString a1 => Resp -> Command [(Field, a1)]
- HIncrBy :: Resp -> Command Int64
- HIncrByFloat :: Resp -> Command Double
- HKeys :: Resp -> Command [Field]
- HLen :: Resp -> Command Int64
- HMGet :: forall a1. FromByteString a1 => Resp -> Command [Maybe a1]
- HMSet :: Resp -> Command ()
- HSet :: Resp -> Command Bool
- HSetNx :: Resp -> Command Bool
- HVals :: forall a1. FromByteString a1 => Resp -> Command [a1]
- HScan :: forall a1. FromByteString a1 => Resp -> Command (Cursor, [a1])
- BLPop :: forall a1. FromByteString a1 => Int64 -> Resp -> Command (Maybe (Key, a1))
- BRPop :: forall a1. FromByteString a1 => Int64 -> Resp -> Command (Maybe (Key, a1))
- BRPopLPush :: forall a1. FromByteString a1 => Int64 -> Resp -> Command (Maybe a1)
- LIndex :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1)
- LInsert :: Resp -> Command Int64
- LLen :: Resp -> Command Int64
- LPop :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1)
- LPush :: Resp -> Command Int64
- LPushX :: Resp -> Command Int64
- LRange :: forall a1. FromByteString a1 => Resp -> Command [a1]
- LRem :: Resp -> Command Int64
- LSet :: Resp -> Command ()
- LTrim :: Resp -> Command ()
- RPop :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1)
- RPopLPush :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1)
- RPush :: Resp -> Command Int64
- RPushX :: Resp -> Command Int64
- SAdd :: Resp -> Command Int64
- SCard :: Resp -> Command Int64
- SDiff :: forall a1. FromByteString a1 => Resp -> Command [a1]
- SDiffStore :: Resp -> Command Int64
- SInter :: forall a1. FromByteString a1 => Resp -> Command [a1]
- SInterStore :: Resp -> Command Int64
- SIsMember :: Resp -> Command Bool
- SMembers :: forall a1. FromByteString a1 => Resp -> Command [a1]
- SMove :: Resp -> Command Bool
- SPop :: forall a1. FromByteString a1 => Resp -> Command (Maybe a1)
- SRandMember :: forall a1. FromByteString a1 => Choose -> Resp -> Command [a1]
- SRem :: Resp -> Command Int64
- SScan :: forall a1. FromByteString a1 => Resp -> Command (Cursor, [a1])
- SUnion :: forall a1. FromByteString a1 => Resp -> Command [a1]
- SUnionStore :: Resp -> Command Int64
- ZAdd :: Resp -> Command Int64
- ZCard :: Resp -> Command Int64
- ZCount :: Resp -> Command Int64
- ZIncrBy :: Resp -> Command Double
- ZInterStore :: Resp -> Command Int64
- ZLexCount :: Resp -> Command Int64
- ZRange :: forall a1. FromByteString a1 => Bool -> Resp -> Command (ScoreList a1)
- ZRangeByLex :: forall a1. FromByteString a1 => Resp -> Command [a1]
- ZRangeByScore :: forall a1. FromByteString a1 => Bool -> Resp -> Command (ScoreList a1)
- ZRank :: Resp -> Command (Maybe Int64)
- ZRem :: Resp -> Command Int64
- ZRemRangeByLex :: Resp -> Command Int64
- ZRemRangeByRank :: Resp -> Command Int64
- ZRemRangeByScore :: Resp -> Command Int64
- ZRevRange :: forall a1. FromByteString a1 => Bool -> Resp -> Command (ScoreList a1)
- ZRevRangeByScore :: forall a1. FromByteString a1 => Bool -> Resp -> Command (ScoreList a1)
- ZRevRank :: Resp -> Command (Maybe Int64)
- ZScan :: forall a1. FromByteString a1 => Resp -> Command (Cursor, [a1])
- ZScore :: Resp -> Command (Maybe Double)
- ZUnionStore :: Resp -> Command Int64
- PfAdd :: Resp -> Command Bool
- PfCount :: Resp -> Command Int64
- PfMerge :: Resp -> Command ()
- Publish :: Resp -> Command Int64
- data PubSubCommand r where
- Subscribe :: Resp -> PubSubCommand ()
- Unsubscribe :: Resp -> PubSubCommand ()
- PSubscribe :: Resp -> PubSubCommand ()
- PUnsubscribe :: Resp -> PubSubCommand ()
- data PushMessage
- = SubscribeMessage {
- channel :: !ByteString
- subscriptions :: !Int64
- | UnsubscribeMessage {
- channel :: !ByteString
- subscriptions :: !Int64
- | Message {
- channel :: !ByteString
- message :: !ByteString
- | PMessage {
- pattern :: !ByteString
- channel :: !ByteString
- message :: !ByteString
- = SubscribeMessage {
- type Result = Either RedisError
- data RedisError
- data RedisType
- data TTL
- data Side
- data Choose
- data Aggregate
- data Min
- = MinIncl !ByteString
- | MinExcl !ByteString
- | MinInf
- data Max
- = MaxIncl !ByteString
- | MaxExcl !ByteString
- | MaxInf
- data ScoreList a = ScoreList {}
- newtype Seconds = Seconds Int64
- newtype Milliseconds = Milliseconds Int64
- newtype Timestamp = Timestamp Int64
- type Field = ByteString
- type Index = Int64
- newtype Key = Key {
- key :: ByteString
- data Cursor
- zero :: Cursor
- one :: a -> NonEmpty a
- data Opts (a :: Symbol)
- none :: Monoid m => m
- data BitStart
- data BitEnd
- start :: Int64 -> BitStart
- end :: Int64 -> BitEnd
- auth :: forall (m :: Type -> Type). Monad m => ByteString -> Redis m ()
- echo :: forall (m :: Type -> Type) a. (Monad m, ToByteString a, FromByteString a) => a -> Redis m a
- ping :: forall (m :: Type -> Type). Monad m => Redis m ()
- quit :: forall (m :: Type -> Type). Monad m => Redis m ()
- select :: forall (m :: Type -> Type). Monad m => Int64 -> Redis m ()
- bgrewriteaof :: forall (m :: Type -> Type). Monad m => Redis m ()
- bgsave :: forall (m :: Type -> Type). Monad m => Redis m ()
- dbsize :: forall (m :: Type -> Type). Monad m => Redis m Int64
- flushall :: forall (m :: Type -> Type). Monad m => Redis m ()
- flushdb :: forall (m :: Type -> Type). Monad m => Redis m ()
- lastsave :: forall (m :: Type -> Type). Monad m => Redis m Int64
- save :: forall (m :: Type -> Type). Monad m => Redis m ()
- discard :: forall (m :: Type -> Type). Monad m => Redis m ()
- exec :: forall (m :: Type -> Type). Monad m => Redis m ()
- multi :: forall (m :: Type -> Type). Monad m => Redis m ()
- unwatch :: forall (m :: Type -> Type). Monad m => Redis m ()
- watch :: forall (m :: Type -> Type). Monad m => NonEmpty Key -> Redis m ()
- del :: forall (m :: Type -> Type). Monad m => NonEmpty Key -> Redis m Int64
- dump :: forall (m :: Type -> Type). Monad m => Key -> Redis m (Maybe ByteString)
- exists :: forall (m :: Type -> Type). Monad m => Key -> Redis m Bool
- expire :: forall (m :: Type -> Type). Monad m => Key -> Seconds -> Redis m Bool
- expireat :: forall (m :: Type -> Type). Monad m => Key -> Timestamp -> Redis m Bool
- keys :: forall (m :: Type -> Type). Monad m => ByteString -> Redis m [Key]
- persist :: forall (m :: Type -> Type). Monad m => Key -> Redis m Bool
- randomkey :: forall (m :: Type -> Type). Monad m => Redis m (Maybe Key)
- rename :: forall (m :: Type -> Type). Monad m => Key -> Key -> Redis m ()
- renamenx :: forall (m :: Type -> Type). Monad m => Key -> Key -> Redis m Bool
- ttl :: forall (m :: Type -> Type). Monad m => Key -> Redis m (Maybe TTL)
- typeof :: forall (m :: Type -> Type). Monad m => Key -> Redis m (Maybe RedisType)
- append :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m Int64
- decr :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64
- decrby :: forall (m :: Type -> Type). Monad m => Key -> Int64 -> Redis m Int64
- get :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m (Maybe a)
- getrange :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Int64 -> Int64 -> Redis m a
- getset :: forall (m :: Type -> Type) a b. (Monad m, ToByteString a, FromByteString b) => Key -> a -> Redis m (Maybe b)
- incr :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64
- incrby :: forall (m :: Type -> Type). Monad m => Key -> Int64 -> Redis m Int64
- incrbyfloat :: forall (m :: Type -> Type). Monad m => Key -> Double -> Redis m Double
- mget :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Redis m [Maybe a]
- mset :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => NonEmpty (Key, a) -> Redis m ()
- msetnx :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => NonEmpty (Key, a) -> Redis m Bool
- set :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Opts "SET" -> Redis m Bool
- ex :: Seconds -> Opts "SET"
- px :: Milliseconds -> Opts "SET"
- xx :: Opts "SET"
- nx :: Opts "SET"
- setrange :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Int64 -> a -> Redis m Int64
- strlen :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64
- bitand :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m Int64
- bitcount :: forall (m :: Type -> Type). Monad m => Key -> Opts "RANGE" -> Redis m Int64
- range :: Int64 -> Int64 -> Opts "RANGE"
- bitnot :: forall (m :: Type -> Type). Monad m => Key -> Key -> Redis m Int64
- bitor :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m Int64
- bitpos :: forall (m :: Type -> Type). Monad m => Key -> Bool -> BitStart -> BitEnd -> Redis m Int64
- bitxor :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m Int64
- getbit :: forall (m :: Type -> Type). Monad m => Key -> Int64 -> Redis m Int64
- setbit :: forall (m :: Type -> Type). Monad m => Key -> Int64 -> Bool -> Redis m Int64
- hdel :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Field -> Redis m Int64
- hexists :: forall (m :: Type -> Type). Monad m => Key -> Field -> Redis m Bool
- hget :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Field -> Redis m (Maybe a)
- hgetall :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m [(Field, a)]
- hincrby :: forall (m :: Type -> Type). Monad m => Key -> Field -> Int64 -> Redis m Int64
- hincrbyfloat :: forall (m :: Type -> Type). Monad m => Key -> Field -> Double -> Redis m Double
- hkeys :: forall (m :: Type -> Type). Monad m => Key -> Redis m [Field]
- hlen :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64
- hmget :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> NonEmpty Field -> Redis m [Maybe a]
- hmset :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty (Field, a) -> Redis m ()
- hset :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Field -> a -> Redis m Bool
- hsetnx :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Field -> a -> Redis m Bool
- hvals :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m [a]
- blpop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Seconds -> Redis m (Maybe (Key, a))
- brpop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Seconds -> Redis m (Maybe (Key, a))
- brpoplpush :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Key -> Seconds -> Redis m (Maybe a)
- lindex :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Index -> Redis m (Maybe a)
- linsert :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Side -> a -> a -> Redis m Int64
- llen :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64
- lpop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m (Maybe a)
- lpush :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64
- lpushx :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m Int64
- lrange :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Int64 -> Int64 -> Redis m [a]
- lrem :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Int64 -> a -> Redis m Int64
- lset :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Int64 -> a -> Redis m ()
- ltrim :: forall (m :: Type -> Type). Monad m => Key -> Int64 -> Int64 -> Redis m ()
- rpop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m (Maybe a)
- rpoplpush :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Key -> Redis m (Maybe a)
- rpush :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64
- rpushx :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m Int64
- sadd :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64
- scard :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64
- sdiff :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Redis m [a]
- sdiffstore :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m Int64
- sinter :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Redis m [a]
- sinterstore :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m Int64
- sismember :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m Bool
- smembers :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m [a]
- smove :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Key -> a -> Redis m Bool
- spop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m (Maybe a)
- srandmember :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Choose -> Redis m [a]
- srem :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64
- sunion :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Redis m [a]
- sunionstore :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m Int64
- zadd :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty (Double, a) -> Redis m Int64
- zcard :: forall (m :: Type -> Type). Monad m => Key -> Redis m Int64
- zcount :: forall (m :: Type -> Type). Monad m => Key -> Double -> Double -> Redis m Int64
- zincrby :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Double -> a -> Redis m Double
- zinterstore :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> [Int64] -> Aggregate -> Redis m Int64
- zlexcount :: forall (m :: Type -> Type). Monad m => Key -> Min -> Max -> Redis m Int64
- zrange :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Int64 -> Int64 -> Bool -> Redis m (ScoreList a)
- zrangebylex :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Min -> Max -> Opts "LIMIT" -> Redis m [a]
- zrangebyscore :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Double -> Double -> Bool -> Opts "LIMIT" -> Redis m (ScoreList a)
- zrank :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m (Maybe Int64)
- zrem :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64
- zremrangebylex :: forall (m :: Type -> Type). Monad m => Key -> Min -> Max -> Redis m Int64
- zremrangebyrank :: forall (m :: Type -> Type). Monad m => Key -> Int64 -> Int64 -> Redis m Int64
- zremrangebyscore :: forall (m :: Type -> Type). Monad m => Key -> Double -> Double -> Redis m Int64
- zrevrangebyscore :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Double -> Double -> Bool -> Opts "LIMIT" -> Redis m (ScoreList a)
- zrevrange :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Int64 -> Int64 -> Bool -> Redis m (ScoreList a)
- zrevrank :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m (Maybe Int64)
- zscore :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m (Maybe Double)
- zunionstore :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> [Int64] -> Aggregate -> Redis m Int64
- pfadd :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Bool
- pfcount :: forall (m :: Type -> Type). Monad m => NonEmpty Key -> Redis m Int64
- pfmerge :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> Redis m ()
- scan :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Cursor -> Opts "SCAN" -> Redis m (Cursor, [a])
- match :: ByteString -> Opts "SCAN"
- count :: Int64 -> Opts "SCAN"
- hscan :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Cursor -> Opts "SCAN" -> Redis m (Cursor, [a])
- sscan :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Cursor -> Opts "SCAN" -> Redis m (Cursor, [a])
- zscan :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Cursor -> Opts "SCAN" -> Redis m (Cursor, [a])
- sort :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Opts "SORT" -> Redis m [a]
- by :: ByteString -> Opts "SORT"
- limit :: forall (o :: Symbol). Int64 -> Int64 -> Opts o
- getkey :: NonEmpty ByteString -> Opts "SORT"
- asc :: Opts "SORT"
- desc :: Opts "SORT"
- alpha :: Opts "SORT"
- store :: Key -> Opts "SORT"
- publish :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => ByteString -> a -> Redis m Int64
- subscribe :: forall (m :: Type -> Type). Monad m => NonEmpty ByteString -> PubSub m ()
- psubscribe :: forall (m :: Type -> Type). Monad m => NonEmpty ByteString -> PubSub m ()
- unsubscribe :: forall (m :: Type -> Type). Monad m => [ByteString] -> PubSub m ()
- punsubscribe :: forall (m :: Type -> Type). Monad m => [ByteString] -> PubSub m ()
- readInt :: String -> Resp -> Result Int64
- readInt'Null :: String -> Resp -> Result (Maybe Int64)
- readBool :: String -> Resp -> Result Bool
- readTTL :: String -> Resp -> Result (Maybe TTL)
- readBulk'Null :: FromByteString a => String -> Resp -> Result (Maybe a)
- readBulk :: FromByteString a => String -> Resp -> Result a
- readListOfMaybes :: FromByteString a => String -> Resp -> Result [Maybe a]
- readList :: FromByteString a => String -> Resp -> Result [a]
- readScoreList :: FromByteString a => String -> Bool -> Resp -> Result (ScoreList a)
- readFields :: FromByteString a => String -> Resp -> Result [(Field, a)]
- readKeyValue :: FromByteString a => String -> Resp -> Result (Maybe (Key, a))
- readBulk'Array :: FromByteString a => String -> Choose -> Resp -> Result [a]
- readScan :: FromByteString a => String -> Resp -> Result (Cursor, [a])
- matchStr :: String -> ByteString -> Resp -> Result ()
- readType :: String -> Resp -> Result (Maybe RedisType)
- fromSet :: Resp -> Result Bool
- anyStr :: String -> Resp -> Result ()
- readPushMessage :: Resp -> Result PushMessage
- data NonEmpty a = a :| [a]
- nonEmpty :: [a] -> Maybe (NonEmpty a)
Types
type PubSub = ProgramT PubSubCommand Source #
Redis commands.
Constructors
data PubSubCommand r where Source #
Pub/Sub commands.
Constructors
Subscribe :: Resp -> PubSubCommand () | |
Unsubscribe :: Resp -> PubSubCommand () | |
PSubscribe :: Resp -> PubSubCommand () | |
PUnsubscribe :: Resp -> PubSubCommand () |
data PushMessage Source #
Messages which are published to subscribers.
Constructors
SubscribeMessage | |
Fields
| |
UnsubscribeMessage | |
Fields
| |
Message | |
Fields
| |
PMessage | |
Fields
|
Instances
Show PushMessage Source # | |
Defined in Data.Redis.Command Methods showsPrec :: Int -> PushMessage -> ShowS # show :: PushMessage -> String # showList :: [PushMessage] -> ShowS # | |
Eq PushMessage Source # | |
Defined in Data.Redis.Command | |
Ord PushMessage Source # | |
Defined in Data.Redis.Command Methods compare :: PushMessage -> PushMessage -> Ordering # (<) :: PushMessage -> PushMessage -> Bool # (<=) :: PushMessage -> PushMessage -> Bool # (>) :: PushMessage -> PushMessage -> Bool # (>=) :: PushMessage -> PushMessage -> Bool # max :: PushMessage -> PushMessage -> PushMessage # min :: PushMessage -> PushMessage -> PushMessage # |
type Result = Either RedisError Source #
data RedisError Source #
Redis error type.
Constructors
RedisError !ByteString | General error case. |
InvalidResponse !String | The received response is invalid or unexpected (e.g. a bulk string instead of an integer). |
InvalidConversion !String | ByteString conversion using |
Instances
Exception RedisError Source # | |
Defined in Data.Redis.Command Methods toException :: RedisError -> SomeException # fromException :: SomeException -> Maybe RedisError # displayException :: RedisError -> String # | |
Show RedisError Source # | |
Defined in Data.Redis.Command Methods showsPrec :: Int -> RedisError -> ShowS # show :: RedisError -> String # showList :: [RedisError] -> ShowS # | |
Eq RedisError Source # | |
Defined in Data.Redis.Command | |
Ord RedisError Source # | |
Defined in Data.Redis.Command Methods compare :: RedisError -> RedisError -> Ordering # (<) :: RedisError -> RedisError -> Bool # (<=) :: RedisError -> RedisError -> Bool # (>) :: RedisError -> RedisError -> Bool # (>=) :: RedisError -> RedisError -> Bool # max :: RedisError -> RedisError -> RedisError # min :: RedisError -> RedisError -> RedisError # |
The types redis reports via type.
Constructors
RedisString | |
RedisList | |
RedisSet | |
RedisZSet | |
RedisHash |
Instances
Show RedisType Source # | |
Eq RedisType Source # | |
Ord RedisType Source # | |
A type representing time-to-live values.
Used in linsert
to specify the insertion point.
Constructors
One | Exactly one element |
Dist !Int64 |
|
Arb !Int64 |
|
Constructors
None | no aggregation |
Min | take the minimum score |
Max | take the maximum score |
Sum | addition of scores |
Instances
Show Aggregate Source # | |
Eq Aggregate Source # | |
Ord Aggregate Source # | |
Constructors
MinIncl !ByteString | lower bound (inclusive) |
MinExcl !ByteString | lower bound (exclusive) |
MinInf | infinite lower bound |
Constructors
MaxIncl !ByteString | upper bound (inclusive) |
MaxExcl !ByteString | upper bound (exclusive) |
MaxInf | infinite upper bound |
Instances
Show a => Show (ScoreList a) Source # | |
Eq a => Eq (ScoreList a) Source # | |
Ord a => Ord (ScoreList a) Source # | |
Defined in Data.Redis.Command |
newtype Milliseconds Source #
Constructors
Milliseconds Int64 |
type Field = ByteString Source #
Redis key type
Constructors
Key | |
Fields
|
Cursor
Non-empty lists
Options
data Opts (a :: Symbol) Source #
Command options
Bit
Commands
Connection
echo :: forall (m :: Type -> Type) a. (Monad m, ToByteString a, FromByteString a) => a -> Redis m a Source #
Server
Transactions
multi :: forall (m :: Type -> Type). Monad m => Redis m () Source #
Note that all commands following multi
and until exec
are queued by
a Redis server. Therefore the result of any such command is not available
until the exec command completes. For example, the following is an invalid
Redis
program:
multi x <- hexists "FOO" "BAR" unless x (void $ hset "FOO" "BAR" 1) exec
This pattern is usually indicative of the desire for a transactional check-and-set operation, which may be achieved instead by the following valid command sequence:
watch ("FOO" R.:| []) x <- hexists "FOO" "BAR" multi unless x (void $ hset "FOO" "BAR" 1) exec
For more information on Redis transactions and conditional updates, see https://redis.io/topics/transactions.
Keys
Strings
append :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m Int64 Source #
get :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m (Maybe a) Source #
getrange :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Int64 -> Int64 -> Redis m a Source #
getset :: forall (m :: Type -> Type) a b. (Monad m, ToByteString a, FromByteString b) => Key -> a -> Redis m (Maybe b) Source #
mget :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Redis m [Maybe a] Source #
mset :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => NonEmpty (Key, a) -> Redis m () Source #
msetnx :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => NonEmpty (Key, a) -> Redis m Bool Source #
set :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Opts "SET" -> Redis m Bool Source #
px :: Milliseconds -> Opts "SET" Source #
setrange :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Int64 -> a -> Redis m Int64 Source #
Bits
bitpos :: forall (m :: Type -> Type). Monad m => Key -> Bool -> BitStart -> BitEnd -> Redis m Int64 Source #
Hashes
hget :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Field -> Redis m (Maybe a) Source #
hgetall :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m [(Field, a)] Source #
hincrbyfloat :: forall (m :: Type -> Type). Monad m => Key -> Field -> Double -> Redis m Double Source #
hmget :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> NonEmpty Field -> Redis m [Maybe a] Source #
hmset :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty (Field, a) -> Redis m () Source #
hset :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Field -> a -> Redis m Bool Source #
hsetnx :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Field -> a -> Redis m Bool Source #
Lists
blpop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Seconds -> Redis m (Maybe (Key, a)) Source #
brpop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Seconds -> Redis m (Maybe (Key, a)) Source #
brpoplpush :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Key -> Seconds -> Redis m (Maybe a) Source #
lindex :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Index -> Redis m (Maybe a) Source #
linsert :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Side -> a -> a -> Redis m Int64 Source #
lpop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m (Maybe a) Source #
lpush :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64 Source #
lpushx :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m Int64 Source #
lrange :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Int64 -> Int64 -> Redis m [a] Source #
lrem :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Int64 -> a -> Redis m Int64 Source #
lset :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Int64 -> a -> Redis m () Source #
rpop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m (Maybe a) Source #
rpoplpush :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Key -> Redis m (Maybe a) Source #
rpush :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64 Source #
rpushx :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m Int64 Source #
Sets
sadd :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64 Source #
sdiff :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Redis m [a] Source #
sinter :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Redis m [a] Source #
sismember :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m Bool Source #
smembers :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m [a] Source #
smove :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Key -> a -> Redis m Bool Source #
spop :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Redis m (Maybe a) Source #
srandmember :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Choose -> Redis m [a] Source #
srem :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64 Source #
sunion :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => NonEmpty Key -> Redis m [a] Source #
Sorted Sets
zadd :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty (Double, a) -> Redis m Int64 Source #
zincrby :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> Double -> a -> Redis m Double Source #
zinterstore :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> [Int64] -> Aggregate -> Redis m Int64 Source #
zrange :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Int64 -> Int64 -> Bool -> Redis m (ScoreList a) Source #
zrangebylex :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Min -> Max -> Opts "LIMIT" -> Redis m [a] Source #
zrangebyscore :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Double -> Double -> Bool -> Opts "LIMIT" -> Redis m (ScoreList a) Source #
zrank :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m (Maybe Int64) Source #
zrem :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Int64 Source #
zremrangebylex :: forall (m :: Type -> Type). Monad m => Key -> Min -> Max -> Redis m Int64 Source #
zremrangebyrank :: forall (m :: Type -> Type). Monad m => Key -> Int64 -> Int64 -> Redis m Int64 Source #
zremrangebyscore :: forall (m :: Type -> Type). Monad m => Key -> Double -> Double -> Redis m Int64 Source #
zrevrangebyscore :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Double -> Double -> Bool -> Opts "LIMIT" -> Redis m (ScoreList a) Source #
zrevrange :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Int64 -> Int64 -> Bool -> Redis m (ScoreList a) Source #
zrevrank :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m (Maybe Int64) Source #
zscore :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> a -> Redis m (Maybe Double) Source #
zunionstore :: forall (m :: Type -> Type). Monad m => Key -> NonEmpty Key -> [Int64] -> Aggregate -> Redis m Int64 Source #
HyperLogLog
pfadd :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => Key -> NonEmpty a -> Redis m Bool Source #
Scan
scan :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Cursor -> Opts "SCAN" -> Redis m (Cursor, [a]) Source #
match :: ByteString -> Opts "SCAN" Source #
hscan :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Cursor -> Opts "SCAN" -> Redis m (Cursor, [a]) Source #
sscan :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Cursor -> Opts "SCAN" -> Redis m (Cursor, [a]) Source #
zscan :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Cursor -> Opts "SCAN" -> Redis m (Cursor, [a]) Source #
Sort
sort :: forall (m :: Type -> Type) a. (Monad m, FromByteString a) => Key -> Opts "SORT" -> Redis m [a] Source #
by :: ByteString -> Opts "SORT" Source #
Pub/Sub
publish :: forall (m :: Type -> Type) a. (Monad m, ToByteString a) => ByteString -> a -> Redis m Int64 Source #
psubscribe :: forall (m :: Type -> Type). Monad m => NonEmpty ByteString -> PubSub m () Source #
unsubscribe :: forall (m :: Type -> Type). Monad m => [ByteString] -> PubSub m () Source #
punsubscribe :: forall (m :: Type -> Type). Monad m => [ByteString] -> PubSub m () Source #
Response Reading
readBulk'Null :: FromByteString a => String -> Resp -> Result (Maybe a) Source #
readListOfMaybes :: FromByteString a => String -> Resp -> Result [Maybe a] Source #
readScoreList :: FromByteString a => String -> Bool -> Resp -> Result (ScoreList a) Source #
readFields :: FromByteString a => String -> Resp -> Result [(Field, a)] Source #
readKeyValue :: FromByteString a => String -> Resp -> Result (Maybe (Key, a)) Source #
readBulk'Array :: FromByteString a => String -> Choose -> Resp -> Result [a] Source #
readPushMessage :: Resp -> Result PushMessage Source #
Re-exports
Non-empty (and non-strict) list type.
Since: base-4.9.0.0
Constructors
a :| [a] infixr 5 |
Instances
MonadFix NonEmpty | Since: base-4.9.0.0 | ||||
Defined in Control.Monad.Fix | |||||
MonadZip NonEmpty | Since: base-4.9.0.0 | ||||
Foldable NonEmpty | Since: base-4.9.0.0 | ||||
Defined in Data.Foldable Methods fold :: Monoid m => NonEmpty m -> m # foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m # foldMap' :: Monoid m => (a -> m) -> NonEmpty a -> m # foldr :: (a -> b -> b) -> b -> NonEmpty a -> b # foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b # foldl :: (b -> a -> b) -> b -> NonEmpty a -> b # foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b # foldr1 :: (a -> a -> a) -> NonEmpty a -> a # foldl1 :: (a -> a -> a) -> NonEmpty a -> a # elem :: Eq a => a -> NonEmpty a -> Bool # maximum :: Ord a => NonEmpty a -> a # minimum :: Ord a => NonEmpty a -> a # | |||||
Foldable1 NonEmpty | Since: base-4.18.0.0 | ||||
Defined in Data.Foldable1 Methods fold1 :: Semigroup m => NonEmpty m -> m # foldMap1 :: Semigroup m => (a -> m) -> NonEmpty a -> m # foldMap1' :: Semigroup m => (a -> m) -> NonEmpty a -> m # toNonEmpty :: NonEmpty a -> NonEmpty a # maximum :: Ord a => NonEmpty a -> a # minimum :: Ord a => NonEmpty a -> a # foldrMap1 :: (a -> b) -> (a -> b -> b) -> NonEmpty a -> b # foldlMap1' :: (a -> b) -> (b -> a -> b) -> NonEmpty a -> b # foldlMap1 :: (a -> b) -> (b -> a -> b) -> NonEmpty a -> b # foldrMap1' :: (a -> b) -> (a -> b -> b) -> NonEmpty a -> b # | |||||
Eq1 NonEmpty | Since: base-4.10.0.0 | ||||
Ord1 NonEmpty | Since: base-4.10.0.0 | ||||
Defined in Data.Functor.Classes | |||||
Read1 NonEmpty | Since: base-4.10.0.0 | ||||
Defined in Data.Functor.Classes | |||||
Show1 NonEmpty | Since: base-4.10.0.0 | ||||
Traversable NonEmpty | Since: base-4.9.0.0 | ||||
Applicative NonEmpty | Since: base-4.9.0.0 | ||||
Functor NonEmpty | Since: base-4.9.0.0 | ||||
Monad NonEmpty | Since: base-4.9.0.0 | ||||
Hashable1 NonEmpty | Since: hashable-1.3.1.0 | ||||
Defined in Data.Hashable.Class | |||||
Generic1 NonEmpty | |||||
Defined in GHC.Generics Associated Types
| |||||
Lift a => Lift (NonEmpty a :: Type) | Since: template-haskell-2.15.0.0 | ||||
Data a => Data (NonEmpty a) | Since: base-4.9.0.0 | ||||
Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NonEmpty a -> c (NonEmpty a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NonEmpty a) # toConstr :: NonEmpty a -> Constr # dataTypeOf :: NonEmpty a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NonEmpty a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NonEmpty a)) # gmapT :: (forall b. Data b => b -> b) -> NonEmpty a -> NonEmpty a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NonEmpty a -> r # gmapQ :: (forall d. Data d => d -> u) -> NonEmpty a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NonEmpty a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmpty a -> m (NonEmpty a) # | |||||
Semigroup (NonEmpty a) | Since: base-4.9.0.0 | ||||
Generic (NonEmpty a) | |||||
Defined in GHC.Generics Associated Types
| |||||
IsList (NonEmpty a) | Since: base-4.9.0.0 | ||||
Read a => Read (NonEmpty a) | Since: base-4.11.0.0 | ||||
Show a => Show (NonEmpty a) | Since: base-4.11.0.0 | ||||
Eq a => Eq (NonEmpty a) | Since: base-4.9.0.0 | ||||
Ord a => Ord (NonEmpty a) | Since: base-4.9.0.0 | ||||
Hashable a => Hashable (NonEmpty a) | |||||
Defined in Data.Hashable.Class | |||||
type Rep1 NonEmpty | Since: base-4.6.0.0 | ||||
Defined in GHC.Generics type Rep1 NonEmpty = D1 ('MetaData "NonEmpty" "GHC.Base" "base" 'False) (C1 ('MetaCons ":|" ('InfixI 'RightAssociative 5) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1 :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 []))) | |||||
type Rep (NonEmpty a) | Since: base-4.6.0.0 | ||||
Defined in GHC.Generics type Rep (NonEmpty a) = D1 ('MetaData "NonEmpty" "GHC.Base" "base" 'False) (C1 ('MetaCons ":|" ('InfixI 'RightAssociative 5) 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a]))) | |||||
type Item (NonEmpty a) | |||||
Defined in GHC.IsList |