redis_codec

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NameRedis = "redis"
	IdRedis   = 'r'
)
View Source
const CRLF = "\r\n"

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkMsg

type BulkMsg struct {
	Arg []byte
}

func MakeBulkMsg

func MakeBulkMsg(arg []byte) *BulkMsg

MakeBulkMsg creates BulkMsg

func (*BulkMsg) Bytes

func (that *BulkMsg) Bytes() []byte

Bytes 串化

type CmdLine

type CmdLine [][]byte

type EmptyMultiBulkMsg

type EmptyMultiBulkMsg struct{}

EmptyMultiBulkMsg 空的消息

func (*EmptyMultiBulkMsg) Bytes

func (r *EmptyMultiBulkMsg) Bytes() []byte

Bytes 序列化

type ErrorMsg

type ErrorMsg struct {
	Status string
}

ErrorMsg 错误的消息

func MakeErrorMsg

func MakeErrorMsg(status string) *ErrorMsg

MakeErrorMsg 创建错误的消息

func (*ErrorMsg) Bytes

func (that *ErrorMsg) Bytes() []byte

type Msg

type Msg interface {
	Bytes() []byte
}

type MultiBulkMsg

type MultiBulkMsg struct {
	Args [][]byte
}

MultiBulkMsg 多行消息

func MakeMultiBulkMsg

func MakeMultiBulkMsg(args [][]byte) *MultiBulkMsg

func (*MultiBulkMsg) Bytes

func (that *MultiBulkMsg) Bytes() []byte

Bytes 把多行消息转换成bytes

type NullBulkMsg

type NullBulkMsg struct{}

NullBulkMsg 空字符串

func MakeNullBulkMsg

func MakeNullBulkMsg() *NullBulkMsg

MakeNullBulkMsg creates a new NullBulkMsg

func (*NullBulkMsg) Bytes

func (r *NullBulkMsg) Bytes() []byte

Bytes 序列化

type NumberMsg

type NumberMsg struct {
	Number int64
}

NumberMsg 整数消息

func MakeNumberMsg

func MakeNumberMsg(number int64) *NumberMsg

MakeNumberMsg 创建整数消息

func (*NumberMsg) Bytes

func (that *NumberMsg) Bytes() []byte

type REDISCodec

type REDISCodec struct{}

func (REDISCodec) ID

func (REDISCodec) ID() byte

func (REDISCodec) Marshal

func (REDISCodec) Marshal(v interface{}) ([]byte, error)

func (REDISCodec) Name

func (REDISCodec) Name() string

func (REDISCodec) Unmarshal

func (REDISCodec) Unmarshal(data []byte, v interface{}) error

type SuccessMsg

type SuccessMsg struct {
	Status string
}

SuccessMsg 状态消息

func MakeSuccessMsg

func MakeSuccessMsg(status string) *SuccessMsg

MakeSuccessMsg 创建正确状态消息

func (*SuccessMsg) Bytes

func (that *SuccessMsg) Bytes() []byte

Jump to

Keyboard shortcuts

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