Documentation
¶
Index ¶
- Constants
- Variables
- func Append(ctx *CmdContext) error
- func Auth(ctx *CmdContext) error
- func BitCount(ctx *CmdContext) error
- func Call(ctx *CmdContext)
- func ClientHelp(ctx *CmdContext) error
- func ClientInfo(ctx *CmdContext) error
- func ClientList(ctx *CmdContext) error
- func Decr(ctx *CmdContext) error
- func DecrBy(ctx *CmdContext) error
- func Delete(ctx *CmdContext) error
- func Echo(ctx *CmdContext) error
- func Exists(ctx *CmdContext) error
- func Expire(ctx *CmdContext) error
- func ExpireAt(ctx *CmdContext) error
- func Get(ctx *CmdContext) error
- func GetBit(ctx *CmdContext) error
- func GetRange(ctx *CmdContext) error
- func GetSet(ctx *CmdContext) error
- func HDel(ctx *CmdContext) error
- func HExists(ctx *CmdContext) error
- func HGet(ctx *CmdContext) error
- func HGetAll(ctx *CmdContext) error
- func HIncrBy(ctx *CmdContext) error
- func HIncrByFloat(ctx *CmdContext) error
- func HKeys(ctx *CmdContext) error
- func HLen(ctx *CmdContext) error
- func HMGet(ctx *CmdContext) error
- func HSetNX(ctx *CmdContext) error
- func HVals(ctx *CmdContext) error
- func HashCmdWithKey(ctx *CmdContext) error
- func Incr(ctx *CmdContext) error
- func IncrBy(ctx *CmdContext) error
- func IncrByFloat(ctx *CmdContext) error
- func Info(ctx *CmdContext) error
- func ListCmd(ctx *CmdContext) error
- func MGet(ctx *CmdContext) error
- func MSet(ctx *CmdContext) error
- func Monitor(ctx *CmdContext) error
- func PExpire(ctx *CmdContext) error
- func PExpireAt(ctx *CmdContext) error
- func PSetEx(ctx *CmdContext) error
- func PTTL(ctx *CmdContext) error
- func Persist(ctx *CmdContext) error
- func Ping(ctx *CmdContext) error
- func Quit(ctx *CmdContext) error
- func SAdd(ctx *CmdContext) error
- func SCard(ctx *CmdContext) error
- func SDiff(ctx *CmdContext) error
- func SDiffServer(ctx *CmdContext) error
- func SDiffStore(ctx *CmdContext) error
- func SInter(ctx *CmdContext) error
- func SInterStore(ctx *CmdContext) error
- func SIsmember(ctx *CmdContext) error
- func SMembers(ctx *CmdContext) error
- func SMove(ctx *CmdContext) error
- func SPop(ctx *CmdContext) error
- func SRandMember(ctx *CmdContext) error
- func SRem(ctx *CmdContext) error
- func SUnion(ctx *CmdContext) error
- func SUnionStore(ctx *CmdContext) error
- func Select(ctx *CmdContext) error
- func Set(ctx *CmdContext) error
- func SetBit(ctx *CmdContext) error
- func SetEx(ctx *CmdContext) error
- func SetNx(ctx *CmdContext) error
- func SetRange(ctx *CmdContext) error
- func Strlen(ctx *CmdContext) error
- func SwapDB(ctx *CmdContext) error
- func TTL(ctx *CmdContext) error
- func TempNotSupport(ctx *CmdContext) error
- func Type(ctx *CmdContext) error
- func ZIncrBy(ctx *CmdContext) error
- func ZSetCmdWithKey(ctx *CmdContext) error
- func ZSetCmdWithKeyMember(ctx *CmdContext) error
- type CmdContext
- type CmdFlag
- type CmdInfo
- type CmdStats
- type Command
- type DBInfo
Constants ¶
const (
MaxRange = 2<<29 - 1 // 512M
)
const (
ModisVer = "0.1.0"
)
Variables ¶
var ( GitSha1 string GitDirty string BuildID string )
Functions ¶
func BitCount ¶
func BitCount(ctx *CmdContext) error
BitCount counts the number of set bits (population counting) in a string.
func ClientHelp ¶
func ClientHelp(ctx *CmdContext) error
func ClientInfo ¶
func ClientInfo(ctx *CmdContext) error
func ClientList ¶
func ClientList(ctx *CmdContext) error
func DecrBy ¶
func DecrBy(ctx *CmdContext) error
DecrBy decrements the integer value of a key by the given number
func Delete ¶
func Delete(ctx *CmdContext) error
Delete removes the specified keys. A key is ignored if it does not exist
func ExpireAt ¶
func ExpireAt(ctx *CmdContext) error
ExpireAt sets an absolute timestamp to expire on key
func GetBit ¶
func GetBit(ctx *CmdContext) error
GetBit gets the bit at offset in the string value stored at key.
func GetRange ¶
func GetRange(ctx *CmdContext) error
GetRange increments the integer value of a keys by the given amount
func GetSet ¶
func GetSet(ctx *CmdContext) error
GetSet sets the string value of a key and return its old value
func HDel ¶
func HDel(ctx *CmdContext) error
HDel removes the specified fields from the hash stored at key
func HExists ¶
func HExists(ctx *CmdContext) error
HExists returns if field is an existing field in the hash stored at key
func HGet ¶
func HGet(ctx *CmdContext) error
HGet returns the value associated with field in the hash stored at key
func HGetAll ¶
func HGetAll(ctx *CmdContext) error
HGetAll returns all fields and values of the hash stored at key
func HIncrBy ¶
func HIncrBy(ctx *CmdContext) error
HIncrBy increments the number stored at field in the hash stored at key by increment
func HIncrByFloat ¶
func HIncrByFloat(ctx *CmdContext) 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 *CmdContext) error
HKeys returns all field names in the hash stored at key
func HLen ¶
func HLen(ctx *CmdContext) error
HLen returns the number of fields contained in the hash stored at key
func HMGet ¶
func HMGet(ctx *CmdContext) error
HMGet returns the values associated with the specified fields in the hash stored at key
func HSetNX ¶
func HSetNX(ctx *CmdContext) error
HSetNX sets field in the hash stored at key to value, only if field does not yet exist
func IncrBy ¶
func IncrBy(ctx *CmdContext) error
IncrBy increments the integer value of a key by the given amount
func IncrByFloat ¶
func IncrByFloat(ctx *CmdContext) error
IncrByFloat increments the float value of a key by the given amount
func ListCmd ¶
func ListCmd(ctx *CmdContext) error
func Monitor ¶
func Monitor(ctx *CmdContext) error
func PExpire ¶
func PExpire(ctx *CmdContext) 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 *CmdContext) 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 *CmdContext) error
PSetEx sets the value and expiration in milliseconds of a key
func PTTL ¶
func PTTL(ctx *CmdContext) 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 *CmdContext) error
Persist removes the existing timeout on key, turning the key from volatile to persistent
func SAdd ¶
func SAdd(ctx *CmdContext) error
SAdd adds the specified members to the set stored at key
func SCard ¶
func SCard(ctx *CmdContext) error
SCard returns the set cardinality (number of elements) of the set stored at key
func SDiff ¶
func SDiff(ctx *CmdContext) error
SDiff returns the members of the set resulting from the difference between the first set and all the successive sets.
func SDiffServer ¶
func SDiffServer(ctx *CmdContext) error
SDiff returns the members of the set resulting from the difference between the first set and all the successive sets.
func SDiffStore ¶
func SDiffStore(ctx *CmdContext) error
SDiffStore stores the difference set between the given sets in the specified set.
func SInter ¶
func SInter(ctx *CmdContext) error
SInter returns the members of the set resulting from the intersection of all the given sets.
func SInterStore ¶
func SInterStore(ctx *CmdContext) error
SInterStore stores the members of the set resulting from the intersection of all the given sets.
func SIsmember ¶
func SIsmember(ctx *CmdContext) error
SIsmember returns if member is a member of the set stored at key
func SMembers ¶
func SMembers(ctx *CmdContext) error
SMembers returns all the members of the set value stored at key
func SMove ¶
func SMove(ctx *CmdContext) error
SMove movies member from the set at source to the set at destination
func SPop ¶
func SPop(ctx *CmdContext) error
SPop removes and returns one or more random elements from the set value storage at key
func SRandMember ¶
func SRandMember(ctx *CmdContext) error
SRandMember returns random members of the set
func SRem ¶
func SRem(ctx *CmdContext) error
SRem removes the specified members from the set stored at key
func SUnion ¶
func SUnion(ctx *CmdContext) error
SUnion returns the members of the set resulting from the union of all the given sets.
func SUnionStore ¶
func SUnionStore(ctx *CmdContext) error
SUnionStore stores the members of the set resulting from the union of all the given sets.
func SetBit ¶
func SetBit(ctx *CmdContext) error
SetBit sets or clears the bit at offset in the string value stored at key.
func SetEx ¶
func SetEx(ctx *CmdContext) error
SetEx sets the value and expiration of a key KEY_NAME TIMEOUT VALUE
func SetNx ¶
func SetNx(ctx *CmdContext) error
SetNx sets the value of a key ,only if the key does not exist
func SetRange ¶
func SetRange(ctx *CmdContext) error
SetRange overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.
func Strlen ¶
func Strlen(ctx *CmdContext) error
Strlen returns the length of the string value stored at key
func TTL ¶
func TTL(ctx *CmdContext) error
TTL returns the remaining time to live of a key that has a timeout
func TempNotSupport ¶
func TempNotSupport(ctx *CmdContext) error
func Type ¶
func Type(ctx *CmdContext) error
Type returns the string representation of the type of the value stored at key
func ZIncrBy ¶
func ZIncrBy(ctx *CmdContext) error
func ZSetCmdWithKey ¶
func ZSetCmdWithKey(ctx *CmdContext) error
func ZSetCmdWithKeyMember ¶
func ZSetCmdWithKeyMember(ctx *CmdContext) error
Types ¶
type CmdContext ¶
type CmdContext struct { Name string // command name,e.g. "client" FullName string // command name,e.g. "client|info" Args [][]byte // command's args,e.g. ["key", "value"] OutContent string // command's output TraceID string // request without decoding, e.g. *2\r\n$3\r\nGET\r\n$3\r\nkey\r\n PlainReq []byte CodecCtx *conncontext.CodecContext ServCtx *conncontext.ServerContext context.Context }
CmdContext is the runtime context of a command
func NewCmdContext ¶
func NewCmdContext(name string, args [][]byte, traceID string, plainReq []byte, codecCtx *conncontext.CodecContext, servCtx *conncontext.ServerContext) *CmdContext
NewCmdContext create a new command context
type CmdInfo ¶
type CmdInfo struct { Cmd Command // number of arguments, it is possible to use -N to say >= N Arity int Flag CmdFlag Stats CmdStats }
CmdInfo describes a command with constraints