redis

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CR \r
	CR = '\r'
	// LF \n
	LF = '\n'
	// ARGBegin '$'
	ARGBegin = '$'
	// CMDBegin '*'
	CMDBegin = '*'
)

Variables

View Source
var (
	// Delims delims
	Delims = []byte("\r\n")
	// NullBulk empty bulk string
	NullBulk = []byte("-1")
	// NullArray empty array
	NullArray = []byte("0")
)

Functions

func InitRedisConn

func InitRedisConn(conn goetty.IOSession)

InitRedisConn init redis conn

func NewRedisDecoder

func NewRedisDecoder() goetty.Decoder

NewRedisDecoder returns a redis protocol decoder

func NewRedisReplyDecoder

func NewRedisReplyDecoder() goetty.Decoder

NewRedisReplyDecoder returns a redis protocol cmd reply decoder

func WriteArray

func WriteArray(lst []interface{}, buf *goetty.ByteBuf)

WriteArray write array resp

func WriteBulk

func WriteBulk(b []byte, buf *goetty.ByteBuf)

WriteBulk write bulk resp

func WriteCommand

func WriteCommand(conn goetty.IOSession, cmd string, args ...interface{}) error

WriteCommand write redis command

func WriteError

func WriteError(err []byte, buf *goetty.ByteBuf)

WriteError write error resp

func WriteFVPairArray

func WriteFVPairArray(fvs [][]byte, buf *goetty.ByteBuf)

WriteFVPairArray write field-value pair array resp

func WriteInteger

func WriteInteger(n int64, buf *goetty.ByteBuf)

WriteInteger write integer resp

func WriteScorePairArray

func WriteScorePairArray(membersAndScores [][]byte, withScores bool, buf *goetty.ByteBuf)

WriteScorePairArray write score-member pair array resp

func WriteSliceArray

func WriteSliceArray(lst [][]byte, buf *goetty.ByteBuf)

WriteSliceArray write slice array resp

func WriteStatus

func WriteStatus(status []byte, buf *goetty.ByteBuf)

WriteStatus write status resp

Types

type BulkResp

type BulkResp []byte

BulkResp bulk resp

type Command

type Command [][]byte

Command redis command

func ReadCommand

func ReadCommand(in *goetty.ByteBuf) (bool, Command, error)

ReadCommand returns redis command from buffer

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

type ErrResp

type ErrResp []byte

ErrResp error resp

type IntegerResp

type IntegerResp []byte

IntegerResp integer resp

type NullArrayResp

type NullArrayResp int

NullArrayResp null array resp

type NullBulkResp

type NullBulkResp int

NullBulkResp null bulk resp

type StatusResp

type StatusResp []byte

StatusResp status resp

Jump to

Keyboard shortcuts

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