js

package
v0.0.0-...-50e0b1d Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(data []byte, path ...string) (newData []byte)

Delete the given path

func ForEach

func ForEach(data []byte, cb func(key string, value []byte) error, path ...string) (err error)

ForEach iterates over the key-value pairs of the JSON object, invoking a given callback for each such entry

func Get

func Get(data []byte, path ...string) (value []byte, err error)

Get the []byte for the given path

func GetBoolean

func GetBoolean(data []byte, path ...string) (value bool, err error)

GetBoolean fetches the value for the given path as a bool

func GetFloat

func GetFloat(data []byte, path ...string) (value float64, err error)

GetFloat fetches the value for the given path as a float64

func GetInt

func GetInt(data []byte, path ...string) (value int64, err error)

GetInt fetches the value for the given path as an int64

func GetString

func GetString(data []byte, path ...string) (value string, err error)

GetString fetches the value for the given path as a string

func GetTime

func GetTime(data []byte, path ...string) (value time.Time, err error)

GetTime fetches the value for the given path as a time.Time

func GetUnsafeString

func GetUnsafeString(data []byte, path ...string) (value string, err error)

GetUnsafeString is like GetString, but unsafe

func GetValue

func GetValue(data []byte, path ...string) (value interface{}, err error)

GetValue fetches the value under the given path as an interface

func Has

func Has(data []byte, path ...string) (exists bool)

Has checks the existence of the given path

func Set

func Set(data []byte, value interface{}, path ...string) (newData []byte, err error)

Set marshal and sets the value for the given path

func SetRawBytes

func SetRawBytes(data []byte, value []byte, path ...string) (newData []byte, err error)

SetRawBytes for the given path

Types

This section is empty.

Jump to

Keyboard shortcuts

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