message

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	// Encode
	//	@Description: 编码指定消息
	//	@param msg 消息对象
	//	@return []byte 消息编码对象
	//	@return error
	//
	Encode(msg any) ([]byte, error)

	// Decode
	//	@Description: 解码消息
	//	@param in 输入字节数据
	//	@return Msg 消息对象
	//	@return error
	//
	Decode(in []byte) (any, error)
}

Codec

@Description: 消息内容解析器

type TextCodec

type TextCodec struct {
}

func (*TextCodec) Decode

func (codec *TextCodec) Decode(in []byte) (any, error)

func (*TextCodec) Encode

func (codec *TextCodec) Encode(msg any) ([]byte, error)

Jump to

Keyboard shortcuts

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