Documentation ¶
Index ¶
- Constants
- Variables
- func Auth(ctx *Context)
- func Call(ctx *Context)
- func Client(ctx *Context)
- func Discard(ctx *Context)
- func Echo(ctx *Context)
- func ErrUnKnownCommand(cmd string) error
- func ErrWrongArgs(cmd string) error
- func Exec(ctx *Context)
- func Info(ctx *Context)
- func Monitor(ctx *Context)
- func Multi(ctx *Context)
- func Ping(ctx *Context)
- func Quit(ctx *Context)
- func RedisCommand(ctx *Context)
- func Select(ctx *Context)
- func SwapDB(ctx *Context)
- func Time(ctx *Context)
- func Token(key, namespace []byte, createAt int64) ([]byte, error)
- func Unwatch(ctx *Context)
- func Verify(token, key []byte) ([]byte, error)
- func Watch(ctx *Context)
- type Base
- type Command
- type Constraint
- type Context
- type Desc
- type Executor
- type Flag
- type MinHeap
- type OnCommit
- func Append(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func BitCount(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func BitField(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func BitOp(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func BitPos(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func BulkString(w io.Writer, s string) OnCommit
- func BytesArray(w io.Writer, a [][]byte) OnCommit
- func Debug(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func Decr(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func DecrBy(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func Delete(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func Exists(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func Expire(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func ExpireAt(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func FlushAll(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func FlushDB(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func Get(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func GetBit(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func GetRange(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func GetSet(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HDel(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HExists(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HGet(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HGetAll(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HIncrBy(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HIncrByFloat(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HKeys(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HLen(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HMGet(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HMSet(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HScan(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HSet(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HSetNX(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HStrLen(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func HVals(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func Incr(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func IncrBy(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func IncrByFloat(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func Integer(w io.Writer, v int64) OnCommit
- func Keys(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func LIndex(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func LInsert(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func LLen(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func LPop(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func LPush(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func LPushx(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func LRange(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func LRem(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func LSet(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func LTrim(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func MGet(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func MSet(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func MSetNx(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func NullBulkString(w io.Writer) OnCommit
- func Object(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func PExpire(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func PExpireAt(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func PSetEx(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func PTTL(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func Persist(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func RPop(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func RPopLPush(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func RPush(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func RPushx(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func RandomKey(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SAdd(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SCard(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SDiff(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SInter(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SIsmember(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SMembers(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SMove(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SPop(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SRem(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SUnion(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func Scan(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func Set(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SetBit(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SetEx(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SetNx(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SetRange(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func SimpleString(w io.Writer, s string) OnCommit
- func Strlen(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func TTL(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func Touch(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func TxnCall(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func Type(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func ZAdd(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func ZCard(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func ZRange(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func ZRangeByScore(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func ZRem(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func ZRevRange(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func ZRevRangeByScore(ctx *Context, txn *db.Transaction) (OnCommit, error)
- func ZScore(ctx *Context, txn *db.Transaction) (OnCommit, error)
- type RedisError
- type Statistic
- type TxnCommand
Constants ¶
const ( // UnKnownCommandStr is the command not find UnKnownCommandStr = "unknown command '%s'" // WrongArgs is for wrong number of arguments error WrongArgs = "ERR wrong number of arguments for '%s' command" )
const (
//ScanMaxCount is the max limitation of a single scan
ScanMaxCount = 255
)
Variables ¶
var ( // OK is the simple string "OK" returned to client OK = "OK" // Queued is the simple string "QUEUED" return to client Queued = "QUEUED" // ErrNoAuth authentication required ErrNoAuth = errors.New("NOAUTH Authentication required") // ErrAuthInvalid invalid password ErrAuthInvalid = errors.New("ERR invalid password") // ErrAuthUnSet Client sent AUTH, but no password is set ErrAuthUnSet = errors.New("ERR Client sent AUTH, but no password is set") // ErrInvalidDB invalid DB index ErrInvalidDB = errors.New("ERR invalid DB index") //ErrExpire expire time in set ErrExpire = errors.New("ERR invalid expire time in set") //ErrExpire expire time in setex ErrExpireSetEx = errors.New("ERR invalid expire time in setex") // ErrInteger value is not an integer or out of range ErrInteger = errors.New("ERR value is not an integer or out of range") // ErrFloat value is not a valid float ErrFloat = errors.New("ERR value is not a valid float") // ErrBitInteger bit is not an integer or out of range ErrBitInteger = errors.New("ERR bit is not an integer or out of range") // ErrBitInvaild the bit argument must be 1 or 0 ErrBitInvaild = errors.New("ERR The bit argument must be 1 or 0") // ErrBitOffset bit offset is not an integer or out of range ErrBitOffset = errors.New("ERR bit offset is not an integer or out of range") //ErrBitOp not must be called with a single source key. ErrBitOp = errors.New("BITOP NOT must be called with a single source key.") // ErrOffset offset is out of range ErrOffset = errors.New("ERR offset is out of range") // ErrIndex offset is out of range ErrIndex = errors.New("ERR index out of range") // ErrSyntax syntax error ErrSyntax = errors.New("ERR syntax error") // ErrMSet wrong number of arguments for MSET ErrMSet = errors.New("ERR wrong number of arguments for MSET") // ErrNoSuchKey reteurn on lset for key which no exist ErrNoSuchKey = errors.New("ERR no such key") // ErrReturnType return data type error ErrReturnType = errors.New("ERR return data type error") //ErrMaximum allows the maximum size of a string ErrMaximum = errors.New("ERR string exceeds maximum allowed size") // ErrMultiNested indicates a nested multi command which is not allowed ErrMultiNested = errors.New("ERR MULTI calls can not be nested") // ErrTypeMismatch Operation against a key holding the wrong kind of value ErrTypeMismatch = errors.New("WRONGTYPE Operation against a key holding the wrong kind of value") // ErrEmptyArray error ErrEmptyArray = errors.New("EmptyArray error") //ErrExec exec without multi ErrExec = errors.New("ERR EXEC without MULTI") //ErrDiscard without multi ErrDiscard = errors.New("ERR DISCARD without MULTI") //argument min or max isn't float ErrMinOrMaxNotFloat = errors.New("ERR min or max is not a float") )
var (
//MaxRangeInteger max index in setrange command
MaxRangeInteger = 2<<29 - 1
)
Functions ¶
func Discard ¶
func Discard(ctx *Context)
Discard flushes all previously queued commands in a transaction and restores the connection state to normal
func ErrUnKnownCommand ¶
ErrUnKnownCommand return RedisError of the cmd
func Info ¶
func Info(ctx *Context)
Info returns information and statistics about the server in a format that is simple to parse by computers and easy to read by humans
func Monitor ¶
func Monitor(ctx *Context)
Monitor streams back every command processed by the Titan server
func Multi ¶
func Multi(ctx *Context)
Multi starts a transaction which will block subsequent commands until 'exec'
func RedisCommand ¶
func RedisCommand(ctx *Context)
RedisCommand returns Array reply of details about all Redis commands
Types ¶
type Base ¶
type Base struct { Version int8 `json:"version"` CreateAt int64 `json:"create_at"` Namespace []byte `json:"namespace"` }
Base token base msg
func (*Base) MarshalBinary ¶
MarshalBinary Namespace SHOULD NOT contains a colon
func (*Base) UnmarshalBinary ¶
UnmarshalBinary token base unmarshl
type Command ¶
type Command func(ctx *Context)
Command is a redis command implementation
func AutoCommit ¶
func AutoCommit(cmd TxnCommand) Command
AutoCommit commits to database after run a txn command
type Constraint ¶
type Constraint struct { Arity int // number of arguments, it is possible to use -N to say >= N Flags Flag FirstKey int LastKey int KeyStep int }
Constraint is the rule of command
type Context ¶
type Context struct { Name string Args []string In io.Reader Out io.Writer TraceID string *context.Context }
Context is the runtime context of a command
type Desc ¶
type Desc struct { Proc Command Stat Statistic Cons Constraint }
Desc describes a command with constraints
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor executes a command
type Flag ¶
type Flag int
Flag is the redis command flag
type OnCommit ¶
type OnCommit func()
OnCommit returns by TxnCommand and will be called after a transaction being committed
func Append ¶
func Append(ctx *Context, txn *db.Transaction) (OnCommit, error)
Append a value to a key
func BitCount ¶ added in v0.6.0
func BitCount(ctx *Context, txn *db.Transaction) (OnCommit, error)
BitCount counts the number of set bits (population counting) in a string.
func BitField ¶ added in v0.6.0
func BitField(ctx *Context, txn *db.Transaction) (OnCommit, error)
BitField performs arbitrary bitfield integer operations on strings
func BitOp ¶ added in v0.6.0
func BitOp(ctx *Context, txn *db.Transaction) (OnCommit, error)
BitOp performs bitwise operations between strings
func BitPos ¶ added in v0.6.0
func BitPos(ctx *Context, txn *db.Transaction) (OnCommit, error)
BitPos finds first bit set or clear in a string
func BulkString ¶
BulkString replies a bulkstring when commit
func BytesArray ¶
BytesArray replies a [][]byte when commit
func Decr ¶
func Decr(ctx *Context, txn *db.Transaction) (OnCommit, error)
Decr decrements the integer value of a key by one
func DecrBy ¶
func DecrBy(ctx *Context, txn *db.Transaction) (OnCommit, error)
DecrBy decrements the integer value of a key by the given number
func Delete ¶
func Delete(ctx *Context, txn *db.Transaction) (OnCommit, error)
Delete removes the specified keys. A key is ignored if it does not exist
func Exists ¶
func Exists(ctx *Context, txn *db.Transaction) (OnCommit, error)
Exists returns if key exists
func Expire ¶
func Expire(ctx *Context, txn *db.Transaction) (OnCommit, error)
Expire sets a timeout on key
func ExpireAt ¶
func ExpireAt(ctx *Context, txn *db.Transaction) (OnCommit, error)
ExpireAt sets an absolute timestamp to expire on key
func FlushAll ¶
func FlushAll(ctx *Context, txn *db.Transaction) (OnCommit, error)
FlushAll cleans up all databases This function is **VERY DANGEROUS**. It's not only running on one single region, but it can delete a large range that spans over many regions, bypassing the Raft layer.
func FlushDB ¶
func FlushDB(ctx *Context, txn *db.Transaction) (OnCommit, error)
FlushDB clears current db This function is **VERY DANGEROUS**. It's not only running on one single region, but it can delete a large range that spans over many regions, bypassing the Raft layer.
func GetBit ¶ added in v0.6.0
func GetBit(ctx *Context, txn *db.Transaction) (OnCommit, error)
GetBit gets the bit at offset in the string value stored at key.
func GetRange ¶
func GetRange(ctx *Context, txn *db.Transaction) (OnCommit, error)
GetRange increments the integer value of a keys by the given amount
func GetSet ¶
func GetSet(ctx *Context, txn *db.Transaction) (OnCommit, error)
GetSet sets the string value of a key and return its old value
func HDel ¶
func HDel(ctx *Context, txn *db.Transaction) (OnCommit, error)
HDel removes the specified fields from the hash stored at key
func HExists ¶
func HExists(ctx *Context, txn *db.Transaction) (OnCommit, error)
HExists returns if field is an existing field in the hash stored at key
func HGet ¶
func HGet(ctx *Context, txn *db.Transaction) (OnCommit, error)
HGet returns the value associated with field in the hash stored at key
func HGetAll ¶
func HGetAll(ctx *Context, txn *db.Transaction) (OnCommit, error)
HGetAll returns all fields and values of the hash stored at key
func HIncrBy ¶
func HIncrBy(ctx *Context, txn *db.Transaction) (OnCommit, error)
HIncrBy increments the number stored at field in the hash stored at key by increment
func HIncrByFloat ¶
func HIncrByFloat(ctx *Context, txn *db.Transaction) (OnCommit, error)
HIncrByFloat increment the specified field of a hash stored at key, and representing a floating point number, by the specified increment
func HKeys ¶
func HKeys(ctx *Context, txn *db.Transaction) (OnCommit, error)
HKeys returns all field names in the hash stored at key
func HLen ¶
func HLen(ctx *Context, txn *db.Transaction) (OnCommit, error)
HLen returns the number of fields contained in the hash stored at key
func HMGet ¶
func HMGet(ctx *Context, txn *db.Transaction) (OnCommit, error)
HMGet returns the values associated with the specified fields in the hash stored at key
func HMSet ¶
func HMSet(ctx *Context, txn *db.Transaction) (OnCommit, error)
HMSet sets the specified fields to their respective values in the hash stored at key
func HScan ¶ added in v0.6.0
func HScan(ctx *Context, txn *db.Transaction) (OnCommit, error)
HScan incrementally iterate hash fields and associated values
func HSet ¶
func HSet(ctx *Context, txn *db.Transaction) (OnCommit, error)
HSet sets field in the hash stored at key to value
func HSetNX ¶
func HSetNX(ctx *Context, txn *db.Transaction) (OnCommit, error)
HSetNX sets field in the hash stored at key to value, only if field does not yet exist
func HStrLen ¶
func HStrLen(ctx *Context, txn *db.Transaction) (OnCommit, error)
HStrLen returns the string length of the value associated with field in the hash stored at key
func HVals ¶
func HVals(ctx *Context, txn *db.Transaction) (OnCommit, error)
HVals returns all values in the hash stored at key
func Incr ¶
func Incr(ctx *Context, txn *db.Transaction) (OnCommit, error)
Incr increments the integer value of a key by one
func IncrBy ¶
func IncrBy(ctx *Context, txn *db.Transaction) (OnCommit, error)
IncrBy increments the integer value of a key by the given amount
func IncrByFloat ¶
func IncrByFloat(ctx *Context, txn *db.Transaction) (OnCommit, error)
IncrByFloat increments the float value of a key by the given amount
func Keys ¶
func Keys(ctx *Context, txn *db.Transaction) (OnCommit, error)
Keys returns all keys matching pattern
func LIndex ¶
func LIndex(ctx *Context, txn *db.Transaction) (OnCommit, error)
LIndex get an element from a list by its index
func LInsert ¶
func LInsert(ctx *Context, txn *db.Transaction) (OnCommit, error)
LInsert insert an element before or after another element in a list
func LLen ¶
func LLen(ctx *Context, txn *db.Transaction) (OnCommit, error)
LLen get the length of a list
func LPop ¶
func LPop(ctx *Context, txn *db.Transaction) (OnCommit, error)
LPop removes and returns the first element of the list stored at key
func LPush ¶
func LPush(ctx *Context, txn *db.Transaction) (OnCommit, error)
LPush inserts an entry to the head of the list
func LPushx ¶
func LPushx(ctx *Context, txn *db.Transaction) (OnCommit, error)
LPushx prepend a value to a list, only if the list exists
func LRange ¶
func LRange(ctx *Context, txn *db.Transaction) (OnCommit, error)
LRange get a range of elements from a list
func LRem ¶
func LRem(ctx *Context, txn *db.Transaction) (OnCommit, error)
LRem remove elements from a list
func LSet ¶
func LSet(ctx *Context, txn *db.Transaction) (OnCommit, error)
LSet set the value of an element in a list by its index
func LTrim ¶
func LTrim(ctx *Context, txn *db.Transaction) (OnCommit, error)
LTrim trim a list to the specified range
func MGet ¶
func MGet(ctx *Context, txn *db.Transaction) (OnCommit, error)
MGet returns the values of all specified key
func MSet ¶
func MSet(ctx *Context, txn *db.Transaction) (OnCommit, error)
MSet sets the given keys to their respective values
func MSetNx ¶
func MSetNx(ctx *Context, txn *db.Transaction) (OnCommit, error)
MSetNx et multiple keys to multiple values,only if none of the keys exist TODO bug
func NullBulkString ¶
NullBulkString replies a null bulkstring when commit
func Object ¶
func Object(ctx *Context, txn *db.Transaction) (OnCommit, error)
Object inspects the internals of Redis Objects
func PExpire ¶
func PExpire(ctx *Context, txn *db.Transaction) (OnCommit, error)
PExpire works exactly like expire but the time to live of the key is specified in milliseconds instead of seconds
func PExpireAt ¶
func PExpireAt(ctx *Context, txn *db.Transaction) (OnCommit, error)
PExpireAt has the same effect and semantic as expireAt, but the Unix time at which the key will expire is specified in milliseconds instead of seconds
func PSetEx ¶
func PSetEx(ctx *Context, txn *db.Transaction) (OnCommit, error)
PSetEx sets the value and expiration in milliseconds of a key
func PTTL ¶
func PTTL(ctx *Context, txn *db.Transaction) (OnCommit, error)
PTTL likes TTL this command returns the remaining time to live of a key that has an expire set, with the sole difference that TTL returns the amount of remaining time in seconds while PTTL returns it in milliseconds
func Persist ¶
func Persist(ctx *Context, txn *db.Transaction) (OnCommit, error)
Persist removes the existing timeout on key, turning the key from volatile to persistent
func RPop ¶
func RPop(ctx *Context, txn *db.Transaction) (OnCommit, error)
RPop remove and get the last element in a list
func RPopLPush ¶
func RPopLPush(ctx *Context, txn *db.Transaction) (OnCommit, error)
RPopLPush remove the last element in a list, prepend it to another list and return it
func RPush ¶
func RPush(ctx *Context, txn *db.Transaction) (OnCommit, error)
RPush append one or multiple values to a list
func RPushx ¶
func RPushx(ctx *Context, txn *db.Transaction) (OnCommit, error)
RPushx append a value to a list, only if the list exists
func RandomKey ¶
func RandomKey(ctx *Context, txn *db.Transaction) (OnCommit, error)
RandomKey returns a random key from the currently selected database
func SAdd ¶
func SAdd(ctx *Context, txn *db.Transaction) (OnCommit, error)
SAdd adds the specified members to the set stored at key
func SCard ¶ added in v0.6.0
func SCard(ctx *Context, txn *db.Transaction) (OnCommit, error)
SCard returns the set cardinality (number of elements) of the set stored at key
func SDiff ¶ added in v0.6.0
func SDiff(ctx *Context, txn *db.Transaction) (OnCommit, error)
SDiff returns the members of the set resulting from the difference between the first set and all the successive sets.
func SInter ¶ added in v0.6.0
func SInter(ctx *Context, txn *db.Transaction) (OnCommit, error)
SInter returns the members of the set resulting from the intersection of all the given sets.
func SIsmember ¶ added in v0.6.0
func SIsmember(ctx *Context, txn *db.Transaction) (OnCommit, error)
SIsmember returns if member is a member of the set stored at key
func SMembers ¶
func SMembers(ctx *Context, txn *db.Transaction) (OnCommit, error)
SMembers returns all the members of the set value stored at key
func SMove ¶ added in v0.6.0
func SMove(ctx *Context, txn *db.Transaction) (OnCommit, error)
SMove movies member from the set at source to the set at destination
func SPop ¶ added in v0.6.0
func SPop(ctx *Context, txn *db.Transaction) (OnCommit, error)
SPop removes and returns one or more random elements from the set value store at key
func SRem ¶ added in v0.6.0
func SRem(ctx *Context, txn *db.Transaction) (OnCommit, error)
SRem removes the specified members from the set stored at key
func SUnion ¶ added in v0.6.0
func SUnion(ctx *Context, txn *db.Transaction) (OnCommit, error)
SUnion returns the members of the set resulting from the union of all the given sets.
func Scan ¶
func Scan(ctx *Context, txn *db.Transaction) (OnCommit, error)
Scan incrementally iterates the key space
func Set ¶
func Set(ctx *Context, txn *db.Transaction) (OnCommit, error)
Set key to hold the string value
func SetBit ¶ added in v0.6.0
func SetBit(ctx *Context, txn *db.Transaction) (OnCommit, error)
SetBit sets or clears the bit at offset in the string value stored at key.
func SetEx ¶
func SetEx(ctx *Context, txn *db.Transaction) (OnCommit, error)
SetEx sets the value and expiration of a key KEY_NAME TIMEOUT VALUE
func SetNx ¶
func SetNx(ctx *Context, txn *db.Transaction) (OnCommit, error)
SetNx sets the value of a key ,only if the key does not exist
func SetRange ¶
func SetRange(ctx *Context, txn *db.Transaction) (OnCommit, error)
SetRange overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.
func SimpleString ¶
SimpleString replies a simplestring when commit
func Strlen ¶
func Strlen(ctx *Context, txn *db.Transaction) (OnCommit, error)
Strlen returns the length of the string value stored at key
func TTL ¶
func TTL(ctx *Context, txn *db.Transaction) (OnCommit, error)
TTL returns the remaining time to live of a key that has a timeout
func Touch ¶ added in v0.6.0
func Touch(ctx *Context, txn *db.Transaction) (OnCommit, error)
Touch alters the last access time of a key(s)
func TxnCall ¶
func TxnCall(ctx *Context, txn *db.Transaction) (OnCommit, error)
TxnCall calls a command with transaction, it is used with multi/exec
func Type ¶
func Type(ctx *Context, txn *db.Transaction) (OnCommit, error)
Type returns the string representation of the type of the value stored at key
func ZAdd ¶ added in v0.6.0
func ZAdd(ctx *Context, txn *db.Transaction) (OnCommit, error)
ZAdd adds the specified members with scores to the sorted set
func ZRangeByScore ¶ added in v0.6.0
func ZRangeByScore(ctx *Context, txn *db.Transaction) (OnCommit, error)
func ZRevRange ¶ added in v0.6.0
func ZRevRange(ctx *Context, txn *db.Transaction) (OnCommit, error)
func ZRevRangeByScore ¶ added in v0.6.0
func ZRevRangeByScore(ctx *Context, txn *db.Transaction) (OnCommit, error)
type TxnCommand ¶
type TxnCommand func(ctx *Context, txn *db.Transaction) (OnCommit, error)
TxnCommand runs a command in transaction