redis

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 8 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() codec.Decoder

NewRedisDecoder returns a redis protocol decoder

func NewRedisReplyDecoder

func NewRedisReplyDecoder() codec.Decoder

NewRedisReplyDecoder returns a redis protocol cmd reply decoder

func WriteArray

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

WriteArray write array resp

func WriteBulk

func WriteBulk(b []byte, buf *buf.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 *buf.ByteBuf)

WriteError write error resp

func WriteFVPairArray

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

WriteFVPairArray write field-value pair array resp

func WriteInteger

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

WriteInteger write integer resp

func WriteScorePairArray

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

WriteScorePairArray write score-member pair array resp

func WriteSliceArray

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

WriteSliceArray write slice array resp

func WriteStatus

func WriteStatus(status []byte, buf *buf.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 *buf.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