jsonutil

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func GetSubobjectBytes added in v0.0.5

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

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 MustGetSubobjectBytes added in v0.0.5

func MustGetSubobjectBytes(data []byte, key string) []byte

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

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