protocol

package
v0.0.0-...-c3f54fb Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrReply

func IsErrReply(reply Reply) bool

func IsOKReply

func IsOKReply(reply Reply) bool

Types

type ArgNumErrReply

type ArgNumErrReply struct {
	Cmd string
}

命令参数数量错误

func NewArgNumErrReply

func NewArgNumErrReply(cmd string) *ArgNumErrReply

func (*ArgNumErrReply) ToBytes

func (r *ArgNumErrReply) ToBytes() []byte

type BulkReply

type BulkReply struct {
	Arg []byte
}

二进制安全 单个bulk $3\r\nkey\r\n

func NewBulkReply

func NewBulkReply(arg []byte) *BulkReply

func (*BulkReply) ToBytes

func (b *BulkReply) ToBytes() []byte

type EmptyMultiBulkReply

type EmptyMultiBulkReply struct {
}

func NewEmptyMultiBulkReply

func NewEmptyMultiBulkReply() *EmptyMultiBulkReply

func (*EmptyMultiBulkReply) ToBytes

func (e *EmptyMultiBulkReply) ToBytes() []byte

type GenericErrReply

type GenericErrReply struct {
	Status string
}

一般错误 -ERR xxxxx

func NewGenericErrReply

func NewGenericErrReply(status string) *GenericErrReply

func (*GenericErrReply) ToBytes

func (s *GenericErrReply) ToBytes() []byte

type IntegerReply

type IntegerReply struct {
	Integer int64
}

Integer :3\r\n

func NewIntegerReply

func NewIntegerReply(integer int64) *IntegerReply

func (*IntegerReply) ToBytes

func (i *IntegerReply) ToBytes() []byte

type MixReply

type MixReply struct {
	// contains filtered or unexported fields
}

func NewMixReply

func NewMixReply() *MixReply

Mix

func (*MixReply) Append

func (m *MixReply) Append(replies ...Reply)

func (*MixReply) ToBytes

func (m *MixReply) ToBytes() []byte

type MultiBulkReply

type MultiBulkReply struct {
	RedisCommand [][]byte
}

二进制安全 多个bulk *2\r\n$5\r\nhello\r\n$5\r\nworld\r\n

func NewMultiBulkReply

func NewMultiBulkReply(command [][]byte) *MultiBulkReply

func (*MultiBulkReply) ToBytes

func (r *MultiBulkReply) ToBytes() []byte

type NoReply

type NoReply struct{}

空回复

func NewNoReply

func NewNoReply() *NoReply

func (*NoReply) ToBytes

func (r *NoReply) ToBytes() []byte

ToBytes marshal redis.Reply

type NullBulkReply

type NullBulkReply struct{}

func NewNullBulkReply

func NewNullBulkReply() *NullBulkReply

func (*NullBulkReply) ToBytes

func (n *NullBulkReply) ToBytes() []byte

type OKReply

type OKReply struct{}

func NewOkReply

func NewOkReply() *OKReply

func (*OKReply) ToBytes

func (r *OKReply) ToBytes() []byte

type PONGReply

type PONGReply struct{}

func NewPONGReply

func NewPONGReply() *PONGReply

func (*PONGReply) ToBytes

func (r *PONGReply) ToBytes() []byte

type QueuedReply

type QueuedReply struct{}

func NewQueuedReply

func NewQueuedReply() *QueuedReply

func (*QueuedReply) ToBytes

func (r *QueuedReply) ToBytes() []byte

type Reply

type Reply interface {
	ToBytes() []byte
}

type SimpleErrReply

type SimpleErrReply struct {
	Status string
}

自定义错误 - xxxxx

func NewSimpleErrReply

func NewSimpleErrReply(status string) *SimpleErrReply

func (*SimpleErrReply) ToBytes

func (s *SimpleErrReply) ToBytes() []byte

type SimpleReply

type SimpleReply struct {
	Str string
}

简单字符串

func NewSimpleReply

func NewSimpleReply(str string) *SimpleReply

func (*SimpleReply) ToBytes

func (s *SimpleReply) ToBytes() []byte

type SyntaxErrReply

type SyntaxErrReply struct{}

语法错误

func NewSyntaxErrReply

func NewSyntaxErrReply() *SyntaxErrReply

func (*SyntaxErrReply) ToBytes

func (s *SyntaxErrReply) ToBytes() []byte

type UnknownErrReply

type UnknownErrReply struct{}

未知错误 -ERR unknown

func NewUnknownErrReply

func NewUnknownErrReply() *UnknownErrReply

func (*UnknownErrReply) ToBytes

func (r *UnknownErrReply) ToBytes() []byte

type WrongTypeErrReply

type WrongTypeErrReply struct{}

底层数据类型错误

func NewWrongTypeErrReply

func NewWrongTypeErrReply() *WrongTypeErrReply

func (*WrongTypeErrReply) ToBytes

func (r *WrongTypeErrReply) ToBytes() []byte

Jump to

Keyboard shortcuts

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