codec

package
v0.3.63 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: LGPL-2.1 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDecode = errors.New("gap-decode") // 解码错误
)
View Source
var (
	ErrEncode = errors.New("gap-encode") // 编码错误
)

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	MsgCreator gap.IMsgCreator // 消息对象构建器
}

Decoder 消息包解码器

func NewDecoder added in v0.3.35

func NewDecoder(msgCreator gap.IMsgCreator) *Decoder

NewDecoder 创建消息包解码器

func (*Decoder) Decode

func (d *Decoder) Decode(data []byte) (gap.MsgPacket, error)

Decode 解码消息包

type Encoder

type Encoder struct{}

Encoder 消息包编码器

func NewEncoder added in v0.3.35

func NewEncoder() *Encoder

NewEncoder 创建消息包编码器

func (*Encoder) Encode

func (*Encoder) Encode(src gap.Origin, seq int64, msg gap.ReadableMsg) (ret binaryutil.RecycleBytes, err error)

Encode 编码消息包

Jump to

Keyboard shortcuts

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