cjson

package
v0.0.0-...-a450568 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotNull        = errors.New("not null")
	ErrNotArray       = errors.New("not an array")
	ErrNotNumber      = errors.New("not a number")
	ErrNotBool        = errors.New("not bool")
	ErrNotMap         = errors.New("not an object")
	ErrNotObjectArray = errors.New("not an object array")
	ErrNotString      = errors.New("not a string")
)

Error values returned when validation functions fail

Functions

func GetJSON

func GetJSON(str string, path string) gjson.Result

GetJSON get the json value by path

Types

type CJson

type CJson interface {
	Get(key interface{}) CJson
	Set(key interface{}, value interface{})

	Raw() interface{}
	Bool() (bool, error)
	Float64() (float64, error)
	fmt.Stringer
}

CJson interface

func Unmarshal

func Unmarshal(data []byte) (CJson, error)

Unmarshal data

Jump to

Keyboard shortcuts

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