sonicKit

package
v3.1.112 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Marshal func(v interface{}) ([]byte, error) = sonic.Marshal

	MarshalToString func(v interface{}) (string, error) = sonic.MarshalString
)
View Source
var (
	Unmarshal func(buf []byte, val interface{}) error = sonic.Unmarshal

	UnmarshalFromString func(buf string, val interface{}) error = sonic.UnmarshalString
)

Functions

func MarshalByAPI

func MarshalByAPI(api sonic.API, v interface{}) ([]byte, error)

func MarshalByAPIWithIndent

func MarshalByAPIWithIndent(api sonic.API, v interface{}, prefix, indent string) ([]byte, error)

MarshalByAPIWithIndent

@param prefix 一般为"" @param indent 推荐值: "\t" || " "(4个空格)

func MarshalToStringByAPI

func MarshalToStringByAPI(api sonic.API, v interface{}) (string, error)

func MarshalToStringByAPIWithIndent

func MarshalToStringByAPIWithIndent(api sonic.API, v interface{}, prefix, indent string) (string, error)

MarshalToStringByAPIWithIndent

@param prefix 一般为"" @param indent 推荐值: "\t" || " "(4个空格)

func NewDecoder

func NewDecoder(api sonic.API, reader io.Reader) sonic.Decoder

NewDecoder 解码器(from json)

func NewEncoder

func NewEncoder(api sonic.API, writer io.Writer) sonic.Encoder

NewEncoder 编码器(to json)

func UnmarshalByAPI

func UnmarshalByAPI(api sonic.API, data []byte, v interface{}) error

func UnmarshalFromStringByAPI

func UnmarshalFromStringByAPI(api sonic.API, str string, v interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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