json

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 13

Documentation

Index

Constants

View Source
const (
	EncodeTypeNormal = 0
	EncodeTypeFast   = 1
	EncodeTypeSort   = 2
)

Variables

View Source
var Api = jsoniter.Config{
	EscapeHTML:             true,
	ValidateJsonRawMessage: true,
	UseNumber:              true,
}.Froze()
View Source
var EscapeApi = jsoniter.Config{
	EscapeHTML: true,
}.Froze()
View Source
var FastApi = jsoniter.Config{}.Froze()
View Source
var SortApi = jsoniter.Config{
	EscapeHTML:             true,
	SortMapKeys:            true,
	ValidateJsonRawMessage: true,
}.Froze()

Functions

func Marshal

func Marshal(data interface{}, encodeType ...int8) []byte

Marshal json encode,return []byte

func MarshalBase

func MarshalBase(value interface{}, encodeType ...int8) ([]byte, error)

MarshalBase marshal data other than base structure

func MarshalBaseToString

func MarshalBaseToString(value interface{}, encodeType ...int8) (string, error)

MarshalBaseToString marshal data to string other than base structure

func MarshalToString

func MarshalToString(data interface{}, encodeType ...int8) string

MarshalToString json encode,return string

Types

This section is empty.

Jump to

Keyboard shortcuts

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