codec

package
v0.0.0-...-012d1c6 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Default = iota
	Json
	Proto
	Xml
	Gob
)

枚举定义常见的消息编码格式

Variables

This section is empty.

Functions

func Add

func Add(c Codec)

func SetDefault

func SetDefault(c Codec)

Types

type Codec

type Codec interface {
	Type() int
	Name() string
	Encode(b *buffer.Buffer, msg interface{}) error
	Decode(b *buffer.Buffer, msg interface{}) error
}

Codec 消息编解码

func Get

func Get(t int) Codec

func GetByName

func GetByName(name string) Codec

Directories

Path Synopsis
protobuf codec
protobuf codec
proto
proto protobuf编解码的简单实现,限制是仅仅支持工具生成协议,好处是不依赖官方库,而且代码量也少
proto protobuf编解码的简单实现,限制是仅仅支持工具生成协议,好处是不依赖官方库,而且代码量也少

Jump to

Keyboard shortcuts

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