coder

package
v2.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

目前这个性能最好,不在乎其内部结构是否缺少 msgp 是msgpack的代码生成实现 vmihailenco/msgpack 是msgpack的非代码实现,这2个玩意儿是大体兼容的,在一些特殊处理下还是有区别:var a []string = nil,就无法混用 大体上,之前遇到的不兼容的地方,都是编码使用msgpack,解码又用的是msgp

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal added in v2.0.1

func Marshal(t T, v any) (data []byte, err error)

func Unmarshal added in v2.0.1

func Unmarshal(t T, data []byte, v any) error

Types

type Coder

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

type T added in v2.0.1

type T uint16
const (
	Raw T = iota
	JSON
	MsgPack
	FilePack
	Protobuf
	Msgp
	MsgPackJSONTag
)

func (T) String added in v2.0.1

func (t T) String() string

Jump to

Keyboard shortcuts

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