json

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Zlib Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefCoder = &coder{}

Functions

func DumpBytes added in v1.2.10

func DumpBytes(obj interface{}, options ...DumpOption) ([]byte, error)

DumpBytes convert Go data object to JSON []byte

func DumpString added in v1.2.10

func DumpString(obj interface{}, options ...DumpOption) (string, error)

DumpString encode Go data object to JSON string

func MustDumpBytes added in v1.2.10

func MustDumpBytes(obj interface{}, options ...DumpOption) []byte

MustDumpBytes encode Go data object to JSON []byte (panic in case of error)

func MustDumpString added in v1.2.10

func MustDumpString(obj interface{}, options ...DumpOption) string

MustDumpString encode Go data object to JSON string (panic in case of error)

func Read added in v0.1.2

func Read(name string, v interface{}) error

func ToString added in v1.4.12

func ToString(o interface{}) string

ToString 序列化参数

func UnQuoteBytes added in v1.6.13

func UnQuoteBytes(s []byte) (t []byte, ok bool)

Types

type DumpOption added in v1.2.10

type DumpOption func(enc *json.Encoder)

func EscapeHTML added in v1.2.10

func EscapeHTML(escape bool) DumpOption

func Indent added in v1.2.10

func Indent(s string) DumpOption

Indent sets the indentation level (passed as string of spaces) for DumpBytes/DumpString

Jump to

Keyboard shortcuts

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