jsonKit

package
v2.1.31 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 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)

func MarshalIndentToString added in v2.1.22

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

MarshalIndentToString

@param indent 为了兼容性,用 " " 替代 "\t".

func MarshalToString

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

func Unmarshal

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

func UnmarshalFromString

func UnmarshalFromString(str string, 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