jsonKit

package
v2.1.41 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v interface{}) ([]byte, error)

func MarshalIndent added in v2.1.22

func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)

MarshalIndent

@param indent 为了兼容性,用" "(4个空格)替代"\t"

func MarshalIndentToString added in v2.1.22

func MarshalIndentToString(v interface{}, prefix, indent string) (string, error)

MarshalIndentToString

@param indent 为了兼容性,用" "(4个空格)替代"\t"

func MarshalIndentToStringWithAPI added in v2.1.40

func MarshalIndentToStringWithAPI(api API, v interface{}, prefix, indent string) (string, error)

MarshalIndentToStringWithAPI

@param indent 为了兼容性,用" "(4个空格)替代"\t"

func MarshalIndentWithAPI added in v2.1.40

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

MarshalIndentWithAPI

@param indent 为了兼容性,用" "(4个空格)替代"\t"

func MarshalToString

func MarshalToString(v interface{}) (string, error)

func MarshalToStringWithAPI added in v2.1.40

func MarshalToStringWithAPI(api API, v interface{}) (string, error)

func MarshalWithAPI added in v2.1.40

func MarshalWithAPI(api API, v interface{}) ([]byte, error)

func SetAPI added in v2.1.40

func SetAPI(api API)

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

func UnmarshalFromString

func UnmarshalFromString(str string, v interface{}) error

func UnmarshalFromStringWithAPI added in v2.1.40

func UnmarshalFromStringWithAPI(api API, str string, v interface{}) error

func UnmarshalWithAPI added in v2.1.40

func UnmarshalWithAPI(api API, data []byte, v interface{}) error

Types

type API added in v2.1.22

type API interface {
	Marshal(v interface{}) ([]byte, error)

	MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)

	MarshalToString(v interface{}) (string, error)

	Unmarshal(data []byte, v interface{}) error

	UnmarshalFromString(str string, v interface{}) error
}

func GetAPI added in v2.1.31

func GetAPI() API

Jump to

Keyboard shortcuts

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