License
Subject to the terms of the MIT license, as written in the included LICENSE.txt file.
Convenience wrappers types for accessing Redis keys.
Note that the API is still subject to change!
The type of a Redis key.
Represents a generic Redis value.
bool remove()Removes the referenced key.bool persist()Removes any existing expiration time for the key.bool moveTo(long dst_database)Moves this key to a different database.void rename(string new_name)Renames the referenced key.bool renameIfNotExist(string new_name)Renames the referenced key if the destination key doesn't exist.this(RedisDatabase db, string key)Represents a Redis string value.
In addition to the methods specific to string values, all operations of
RedisValue are available using an alias this declaration.RedisValue valueT get()T getSet(T value)bool getBit(long offset)bool setBit(long offset, bool value)bool setIfNotExist(T value)string getSubString(long start, long end)long setSubString(long offset, string value)void opAssign(T value)long opOpAssign(string OP)(string value) if (OP == "~")long opUnary(string OP)() if (OP == "++")long opUnary(string OP)() if (OP == "--")long opOpAssign(string OP)(long value) if (OP == "+")long opOpAssign(string OP)(long value) if (OP == "-")long opOpAssign(string OP)(double value) if (OP == "+")long opOpAssign(string OP)(double value) if (OP == "-")this(RedisDatabase db, string key)Represents a Redis hash value.
In addition to the methods specific to hash values, all operations of
RedisValue are available using an alias this declaration.RedisValue valuebool remove()size_t remove(scope string[] fields...)bool exists(string field)bool exists()void opIndexAssign(T value, string field)T opIndex(string field)T get(string field, T def_value)bool setIfNotExist(string field, T value)void opIndexOpAssign(string op)(T value, string field) if (op == "+")void opIndexOpAssign(string op)(T value, string field) if (op == "-")int opApply(scope int delegate(string key, T value) @safe del)int opApply(scope int delegate(string key) @safe del)long length()void getMultiple(T[] dst, scope string[] fields...)this(RedisDatabase db, string key)Represents a Redis list value.
In addition to the methods specific to list values, all operations of
RedisValue are available using an alias this declaration.RedisValue valueDollar opDollar()T opIndex(long index)T opIndex(Dollar index)void opIndexAssign(T value, long index)void opIndexAssign(T value, Dollar index)auto opSlice(S, E)(S start, E end) if ((is(S : long) || is(S == Dollar)) && (is(E : long) || is(E == Dollar)))auto opSlice()()long length()long insertBefore(T pivot, T value)long insertAfter(T pivot, T value)long insertFront(T value)long insertFrontIfExists(T value)long insertBack(T value)long insertBackIfExists(T value)long removeAll(T value)long removeFirst(T value, long count = 1)long removeLast(T value, long count = 1)void trim(long start, long end)T removeFront()T removeBack()Nullable!T removeFrontBlock(Duration max_wait = 0.seconds)int opApply(scope int delegate(T) @safe del)this(RedisDatabase db, string key)DollarRepresents a Redis set value.
In addition to the methods specific to set values, all operations of
RedisValue are available using an alias this declaration.RedisValue valuelong insert(ARGS...)(ARGS args)long remove(T value)bool remove()string pop()long length()string getRandom()bool contains(T value)int opApply(scope int delegate(T value) @safe del)bool intersects(scope RedisSet[] sets...)auto getAll()this(RedisDatabase db, string key)Represents a Redis sorted set value.
In addition to the methods specific to sorted set values, all operations of
RedisValue are available using an alias this declaration.RedisValue valuelong insert(ARGS...)(ARGS args)long remove(ARGS...)(ARGS members)bool remove()long length()long count(string INT = "[]")(double min, double max) if (INT == "[]")long removeRangeByRank(long start, long end)long removeRangeByScore(string INT = "[]")(double min, double max) if (INT == "[]")double opIndexOpAssign(string op)(double value, string member) if (op == "+")long getRank(string member)long getReverseRank(string member)long countByLex(string min, string max)auto rangeByLex(T = string)(string min = "-", string max = "+", long offset = 0, long count = - 1)this(RedisDatabase db, string key)RedisString!T getAsString(T = string)(RedisDatabase db, string key)Returns a handle to a string type value.RedisSet!T getAsSet(T = string)(RedisDatabase db, string key)Returns a handle to a set type value.RedisZSet!T getAsZSet(T = string)(RedisDatabase db, string key)Returns a handle to a set type value.RedisHash!T getAsHash(T = string)(RedisDatabase db, string key)Returns a handle to a hash type value.RedisList!T getAsList(T = string)(RedisDatabase db, string key)Returns a handle to a list type value.string toRedis(T)(T value)Converts the given value to a binary/string representation suitable for Redis storage.