codec

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidPBMessage 无效的 google protobuf 消息
	ErrInvalidPBMessage = errors.New("invalid pb message")
)

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Encode(in interface{}) ([]byte, error)
	Decode(in []byte, out interface{}) error
}

Codec 编码与解码器接口

func NewJSONCodec

func NewJSONCodec() Codec

NewJSONCodec JSON

func NewProtobufCodec

func NewProtobufCodec() Codec

NewProtobufCodec 创建默认的编码与解码器

Jump to

Keyboard shortcuts

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