coder

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 10 Imported by: 4

Documentation

Overview

目前这个性能最好,不在乎其内部结构是否缺少 msgp 是msgpack的代码生成实现 vmihailenco/msgpack 是msgpack的非代码实现,这2个玩意儿是兼容的

Index

Constants

This section is empty.

Variables

View Source
var Coders = map[CoderType]Coder{
	JSON:           new_json_coder(),
	MsgPack:        new_msgpack(),
	MsgPackJSONTag: new_msgpack_with_tag("json"),
	FilePack:       new_file_pack(),
	Protobuf:       new_protobuf_pack(),
	Msgp:           new_msgp_coder(),
	Sonic:          new_sonic_coder(),
}

Functions

This section is empty.

Types

type Coder

type Coder interface {
	Marshal(any) ([]byte, error)
	Unmarshal([]byte, any) error
}

body体的序列化

type CoderType

type CoderType uint16
const (
	JSON CoderType = iota
	MsgPack
	FilePack
	Protobuf
	Msgp
	MsgPackJSONTag
	Sonic
)

Jump to

Keyboard shortcuts

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