jsonutil

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2020 License: MIT Imports: 8 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MarshalPrefix = ""
	MarshalIndent = "    "
)

Functions

func JsonParserGetArrayIntOneOnly

func JsonParserGetArrayIntOneOnly(data []byte, key string) (int, error)

func JsonParserGetArrayString

func JsonParserGetArrayString(data []byte, key string) ([]string, error)

func JsonParserGetArrayStringOneOnly

func JsonParserGetArrayStringOneOnly(data []byte, key string) (string, error)

func MarshalBase64

func MarshalBase64(i interface{}) (string, error)

func MarshalSimple

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

func MustMarshal

func MustMarshal(i interface{}, embedError bool) []byte

func MustMarshalIndent

func MustMarshalIndent(i interface{}, prefix, indent string, embedError bool) []byte

func MustMarshalSimple

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

func MustMarshalString

func MustMarshalString(i interface{}, embedError bool) string

func PrettyPrint

func PrettyPrint(b []byte, prefix, indent string) []byte

PrettyPrint converts a JSON byte array into a prettified byte array.

func ReadFile added in v1.3.0

func ReadFile(filename string, v interface{}) ([]byte, error)

func UnmarshalIoReader

func UnmarshalIoReader(r io.Reader, iface interface{}) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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