codec

package
v0.0.0-...-680e691 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFoundCodec = errors.New("not found codec")
)

Functions

func Decode

func Decode(buf bytex.Buffer, ctype netx.CodecType, msg interface{}) error

Decode 对消息进行解码

func Encode

func Encode(ctype netx.CodecType, msg interface{}) (bytex.Buffer, error)

Encode 对消息进行编码

func GetByName

func GetByName(name string) netx.Codec

GetByName 通过名字获取Codec

func GetByType

func GetByType(t netx.CodecType) netx.Codec

GetByType 通过类型获取Codec

func Register

func Register(c netx.Codec)

Add 添加Codec,非线程安全,通常仅在程序启动时注册

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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