redis

package
v0.0.0-...-3b800f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Set      = "set"
	Get      = "get"
	MGet     = "mget"
	MSet     = "mset"
	Keys     = "keys"
	IncrBy   = "incrby"
	DecrBy   = "decrby"
	GetSet   = "getset"
	Append   = "append"
	SetNX    = "setnx"
	StrLen   = "strlen"
	Del      = "del"
	Decr     = "decr"
	Incr     = "incr"
	SetRange = "setrange"
	MSetNX   = "msetnx"
)
View Source
const (
	// CMDBegin prefix of redis command
	CMDBegin = '*'
	// ProxyBegin 0x01
	ProxyBegin = 0x01
)

Variables

View Source
var (
	// Encoder redis protocol encoder
	Encoder = newRedisEncoder()
	// Decoder redis protocol decoder
	Decoder = newRedisDecoder()
)
View Source
var (
	ErrNotSupportCommand  = []byte("command is not support")
	ErrInvalidCommandResp = []byte("invalid command")
	PongResp              = []byte("PONG")
	OKStatusResp          = []byte("OK")
)
View Source
var (
	// ErrIllegalPacket parse err
	ErrIllegalPacket = errors.New("illegal packet data")
)

Functions

func WriteDocArray

func WriteDocArray(lst []*querypb.Document, buf *goetty.ByteBuf)

WriteDocArray write doc array resp

func WriteFVPairArray

func WriteFVPairArray(lst []*raftcmdpb.FVPair, buf *goetty.ByteBuf)

WriteFVPairArray write field value pair array resp

func WriteScorePairArray

func WriteScorePairArray(lst []*raftcmdpb.ScorePair, withScores bool, buf *goetty.ByteBuf)

WriteScorePairArray write score member pair array resp

Types

type Command

type Command [][]byte

Command redis command

func (Command) Args

func (c Command) Args() [][]byte

Args returns redis command args

func (Command) Cmd

func (c Command) Cmd() []byte

Cmd returns redis command

func (Command) CmdString

func (c Command) CmdString() string

CmdString returns redis command use lower string

func (Command) ToString

func (c Command) ToString() string

ToString returns a redis command as string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL