jsonx

package
v2.0.0-beta3 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

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

Marshal encode value to json string, without html escape

func MarshalIndent

func MarshalIndent(v interface{}, indent string) (string, error)

MarshalIndent is like Marshal but applies Indent to format the output. Each JSON element in the output will begin on a new line beginning with prefix followed by one or more copies of indent according to the indentation nesting.

func MarshalWriter

func MarshalWriter(v interface{}, w io.Writer) error

MarshalWriter encode value and write to a writer, without html escape

func UnMarshal

func UnMarshal[T any](jsonStr string) (*T, error)

UnMarshal parse json encoded string to value

func UnMarshalReader

func UnMarshalReader[T any](r io.Reader) (*T, error)

UnMarshalReader parse json encoded io.Reader to value

Types

This section is empty.

Jump to

Keyboard shortcuts

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