jsonx

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 3 Imported by: 4

README

fjson

github.com/json-iterator/go是比标准json包更快的json序列化/反序列化包。

//高效的json序列化函数
JSONFastMarshal

//高效的json反序列化函数
JSONFastUnmarshal

//高效的json序列化函数,并将json数据进行snappy压缩
JSONFastMarshalSnappy

//高效的json反序列化函数,可以反序列snappy压缩的json数据,也可以反序列化普通的json数据
JSONFastUnmarshalSnappy

//读取json文件并反序列化成对象或map
LoadJSONFile2Obj 

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JSONMarshal   = jsonStd.Marshal
	JSONUnmarshal = jsonStd.Unmarshal
)

标准jsoniter json库 100%兼容

View Source
var (
	JSONFastMarshal   = jsonFast.Marshal
	JSONFastUnmarshal = jsonFast.Unmarshal

	JSONFastMarshalSnappy   = fastMarshalSnappy
	JSONFastUnmarshalSnappy = fastUnmarshalSnappy

	TrySnappyCompress = compressJSON
)

快速jsoniter json库 -- 浮点数会丢失精度,小数点最多后6位

Functions

func LoadJSONFile2Obj

func LoadJSONFile2Obj(fileName string, v interface{}) error

LoadJSONFile2Obj 读取json文件并序列化到传入的指针中

Types

type CompressType

type CompressType byte
const (
	CompressThreshHold              = 256
	CompressSnappy     CompressType = 128
)

Jump to

Keyboard shortcuts

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