trait
RedisClient[M[_]] extends AnyRef
Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
final
def
==(arg0: Any): Boolean
-
def
append(key: ByteString, value: ByteString): M[Long]
-
final
def
asInstanceOf[T0]: T0
-
def
bulkReplyAsDoubleCommand(c: Command, key: ByteString): M[Double]
-
def
bulkReplyAsDoubleOptionCommand(c: Command, key: ByteString): M[Option[Double]]
-
def
bulkReplyCommand(c: Command, key: ByteString): M[ByteString]
-
def
bulkReplyOptionCommand(c: Command, key: ByteString): M[Option[ByteString]]
-
def
clone(): AnyRef
-
def
decr(key: ByteString): M[Long]
-
def
decrBy(key: ByteString, amount: Long): M[Long]
-
def
del(keys: ByteString*): M[Long]
-
final
def
eq(arg0: AnyRef): Boolean
-
def
equals(arg0: Any): Boolean
-
def
executeCommand[T](c: Command, key: ByteString)(goodCase: PartialFunction[Reply, M[T]]): M[T]
-
def
exists(key: ByteString): M[Boolean]
-
def
expire(key: ByteString, ttl: FiniteDuration): M[Boolean]
-
def
expireat(key: ByteString, unixTimeInSeconds: Long): M[Boolean]
-
def
finalize(): Unit
-
def
get(key: ByteString): M[ByteString]
-
final
def
getClass(): Class[_]
-
def
getOption(key: ByteString): M[Option[ByteString]]
-
def
getrange(key: ByteString, from: Long, to: Long): M[ByteString]
-
def
getset(key: ByteString, value: ByteString): M[ByteString]
-
def
getsetOption(key: ByteString, value: ByteString): M[Option[ByteString]]
-
def
hashCode(): Int
-
def
hdel(key: ByteString, fields: ByteString*): M[Long]
-
def
hexists(key: ByteString, field: ByteString): M[Boolean]
-
def
hget(key: ByteString, field: ByteString): M[ByteString]
-
def
hgetOption(key: ByteString, field: ByteString): M[Option[ByteString]]
-
def
hgetall(key: ByteString): M[Seq[ByteString]]
-
def
hincrby(key: ByteString, field: ByteString, amount: Long): M[Long]
-
def
hincrbyfloat(key: ByteString, field: ByteString, amount: Double): M[Double]
-
def
hkeys(key: ByteString): M[Seq[ByteString]]
-
def
hlen(key: ByteString): M[Long]
-
def
hmget(key: ByteString, fields: ByteString*): M[Seq[Option[ByteString]]]
-
def
hmset(key: ByteString, fields: ByteString*): M[Boolean]
-
def
hset(key: ByteString, field: ByteString, value: ByteString): M[Boolean]
-
def
hsetnx(key: ByteString, field: ByteString, value: ByteString): M[Boolean]
-
def
hstrlen(key: ByteString, field: ByteString): M[Long]
-
def
hvals(key: ByteString): M[Seq[ByteString]]
-
def
incr(key: ByteString): M[Long]
-
def
incrby(key: ByteString, amount: Long): M[Long]
-
def
incrbyfloat(key: ByteString, amount: Double): M[Double]
-
def
integerReplyBoolCommand(c: Command, key: ByteString): M[Boolean]
-
def
integerReplyCommand(c: Command, key: ByteString): M[Long]
-
def
integerReplyOptionCommand(c: Command, key: ByteString): M[Option[Long]]
-
final
def
isInstanceOf[T0]: Boolean
-
def
keys(key: ByteString): M[Seq[ByteString]]
-
def
lindex(key: ByteString, index: Long): M[ByteString]
-
def
lindexOption(key: ByteString, index: Long): M[Option[ByteString]]
-
def
linsertAfter(key: ByteString, pivotValue: ByteString, value: ByteString): M[Long]
-
def
linsertBefore(key: ByteString, pivotValue: ByteString, value: ByteString): M[Long]
-
def
llen(key: ByteString): M[Long]
-
def
lpop(key: ByteString): M[ByteString]
-
def
lpopOption(key: ByteString): M[Option[ByteString]]
-
def
lpush(key: ByteString, values: ByteString*): M[Long]
-
def
lpushx(key: ByteString, value: ByteString): M[Long]
-
def
lrange(key: ByteString, start: Long, end: Long): M[Seq[ByteString]]
-
def
lrem(key: ByteString, count: Long, value: ByteString): M[Long]
-
def
lset(key: ByteString, index: Long, value: ByteString): M[Boolean]
-
def
ltrim(key: ByteString, start: Long, end: Long): M[Boolean]
-
def
mBulkReplyCommand(c: Command, key: ByteString): M[Seq[ByteString]]
-
def
mBulkReplyOptionCommand(c: Command, key: ByteString): M[Seq[Option[ByteString]]]
-
def
mget(keys: ByteString*): M[Seq[Option[ByteString]]]
-
def
mset(keysAndValues: ByteString*): M[Boolean]
-
def
msetnx(keysAndValues: ByteString*): M[Boolean]
-
final
def
ne(arg0: AnyRef): Boolean
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
persist(key: ByteString): M[Boolean]
-
def
pexpire(key: ByteString, ttl: FiniteDuration): M[Boolean]
-
def
pexpireat(key: ByteString, unixTimeInMillis: Long): M[Boolean]
-
def
psetex(key: ByteString, value: ByteString, ttl: FiniteDuration): M[Boolean]
-
def
pttl(key: ByteString): M[Long]
-
def
randomkey(): M[Option[ByteString]]
-
def
rename(source: ByteString, destination: ByteString): M[Boolean]
-
def
renamenx(source: ByteString, destination: ByteString): M[Boolean]
-
def
rpop(key: ByteString): M[ByteString]
-
def
rpopOption(key: ByteString): M[Option[ByteString]]
-
def
rpoplpush(key: ByteString, destination: ByteString): M[ByteString]
-
def
rpoplpushOption(key: ByteString, destination: ByteString): M[Option[ByteString]]
-
def
rpush(key: ByteString, values: ByteString*): M[Long]
-
def
rpushx(key: ByteString, value: ByteString): M[Long]
-
def
sadd(key: ByteString, values: ByteString*): M[Long]
-
def
scard(key: ByteString): M[Long]
-
def
sdiff(key: ByteString, keys: ByteString*): M[Set[ByteString]]
-
def
sdiffstore(destination: ByteString, key: ByteString, keys: ByteString*): M[Long]
-
def
set(key: ByteString, value: ByteString): M[Boolean]
-
def
setex(key: ByteString, value: ByteString, ttl: FiniteDuration): M[Boolean]
-
def
setnx(key: ByteString, value: ByteString): M[Boolean]
-
def
sinter(key: ByteString, keys: ByteString*): M[Set[ByteString]]
-
def
sinterstore(destination: ByteString, key: ByteString, keys: ByteString*): M[Long]
-
def
sismember(key: ByteString, value: ByteString): M[Boolean]
-
def
smembers(key: ByteString): M[Set[ByteString]]
-
def
smove(source: ByteString, destination: ByteString, value: ByteString): M[Boolean]
-
def
spop(key: ByteString): M[ByteString]
-
def
spopOption(key: ByteString): M[Option[ByteString]]
-
def
srandmember(key: ByteString, count: Long): M[Seq[ByteString]]
-
def
srandmember(key: ByteString): M[ByteString]
-
def
srandmemberOption(key: ByteString): M[Option[ByteString]]
-
def
srem(key: ByteString, values: ByteString*): M[Long]
-
def
stringReplyCommand(c: Command, key: ByteString): M[Boolean]
-
def
strlen(key: ByteString): M[Long]
-
def
sunion(key: ByteString, keys: ByteString*): M[Set[ByteString]]
-
def
sunionstore(destination: ByteString, key: ByteString, keys: ByteString*): M[Long]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
def
ttl(key: ByteString): M[Long]
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
-
def
zadd(key: ByteString, valuesAndArguments: ByteString*): M[Double]
-
def
zcard(key: ByteString): M[Long]
-
def
zcount(key: ByteString, from: Option[Double] = None, to: Option[Double]): M[Long]
-
def
zincrby(key: ByteString, amount: Double, value: ByteString): M[Double]
-
def
zinterstore(key: ByteString, numKeys: Long, keysAndArguments: ByteString*): M[Long]
-
def
zlexcount(key: ByteString, min: ByteString = ByteString("-"), max: ByteString = ByteString("+")): M[Long]
-
def
zrange(key: ByteString, start: Long, stop: Long, arguments: ByteString*): M[Seq[ByteString]]
-
def
zrangebylex(key: ByteString, min: ByteString, max: ByteString, arguments: ByteString*): M[Seq[ByteString]]
-
def
zrangebyscore(key: ByteString, min: ByteString, max: ByteString, arguments: ByteString*): M[Seq[ByteString]]
-
def
zrank(key: ByteString, value: ByteString): M[Long]
-
def
zrankOption(key: ByteString, value: ByteString): M[Option[Long]]
-
def
zrem(key: ByteString, values: ByteString*): M[Long]
-
def
zremrangebylex(key: ByteString, min: ByteString, max: ByteString): M[Long]
-
def
zremrangebyrank(key: ByteString, start: Long, stop: Long): M[Long]
-
def
zremrangebyscore(key: ByteString, min: ByteString, max: ByteString): M[Long]
-
def
zrevrange(key: ByteString, start: Long, stop: Long, arguments: ByteString*): M[Seq[ByteString]]
-
def
zrevrangebylex(key: ByteString, max: ByteString, min: ByteString, arguments: ByteString*): M[Seq[ByteString]]
-
def
zrevrangebyscore(key: ByteString, max: ByteString, min: ByteString, arguments: ByteString*): M[Seq[ByteString]]
-
def
zrevrank(key: ByteString, value: ByteString): M[Long]
-
def
zrevrankOption(key: ByteString, value: ByteString): M[Option[Long]]
-
def
zscore(key: ByteString, value: ByteString): M[Double]
-
def
zscoreOption(key: ByteString, value: ByteString): M[Option[Double]]
-
def
zunionstore(key: ByteString, numKeys: Long, keysAndArguments: ByteString*): M[Long]
Inherited from AnyRef
Inherited from Any
This trait houses the Redis API. It contains implementations for most(not all) commands. In particular, this trait makes a best attempt at providing all implementations for: - Key commands - String commands - Hash commands - List commands - Set commands - Zset commands
Commands not implemented yet are
Just because these commands are not implemented, doesn't mean they cannot be used. The implementors of this trait provide a generic 'execute' command, which allows for the execution of arbitrary colossus.protocols.redis.Commandobjects. The calling code is responsible for handling the raw colossus.protocols.redis.Reply.
In some cases if a command can return an optional response(ie: a bulk reply or nil reply, like 'get'), 2 variants are provided. One which will return the data directly, and fail if its not there, and another which returns an Option. This is done to provide the user with some flexibility in how they query data. The point being, if you want to query and fail on non existence, you don't have to deal w/ an intermediate Option.
No camelcase? Yea..camelcasing redis commands looked and felt weird. MGet? mGet? mget? mSetNx? msetNX? etc. So, since all redis commands are uppercased(at least in the docs), I went with all lower case for the API. I just wanted something consistent looking. The only camelcasing is for the functions which return options ie: getOption.
This trait tries its best to be redis version agonstic. It doesn't know anything about the version of redis you are communicating with, so, for example, if an 'hstrlen' command is issued to a redis server that's < 3.2, you will get an Exception.
Some commands(mainly zset commands) have additional arguments which alter its behavior. Instead of trying to capture all the argument combinations the function provides a varargs ByteString so that the user can provide whatever trailing flags or options they want. Each command which has this behavior is noted in its docs.