mjson

package
v0.0.0-...-5ae263f Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsArray

func IsArray(b []byte) bool

IsArray returns true whether the byte slice may be invalid JSON or if it's a an array. That is, if you don't know whether a JSON message contains `T[]` or `T`, IsArray will tell you whether you should try to unmarshal it as T[].

func Keys

func Keys(b []byte) ([]string, error)

Keys lists object keys in the object.

func ToArray

func ToArray(items [][]byte) []byte

ToArray assumes the list of byte slices are raw JSON messages, and joins them into an array. Note: if you know the total length of the items beforehand, use ToArrayWithLength.

func ToArrayWithLength

func ToArrayWithLength(items [][]byte, totalSize int) []byte

ToArrayWithLength joins the items into a JSON array.

Types

This section is empty.

Jump to

Keyboard shortcuts

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