json

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(v interface{}) ([]byte, error)

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Types

type Array

type Array struct {
	// contains filtered or unexported fields
}

func (*Array) ForEach

func (obj *Array) ForEach(fn func(int, *Object))

func (*Array) ForEachArray

func (obj *Array) ForEachArray(fn func(int, *Array))

func (*Array) GetArray

func (obj *Array) GetArray(i int) *Array

func (*Array) GetObject

func (obj *Array) GetObject(i int) *Object

func (*Array) Length

func (obj *Array) Length() int

func (*Array) ToString added in v1.0.4

func (obj *Array) ToString() string

type Object

type Object struct {
	// contains filtered or unexported fields
}

func NewJsonObject

func NewJsonObject(str string) (*Object, error)

func NewJsonObjectWithMap

func NewJsonObjectWithMap(m map[string]interface{}) *Object

func (*Object) ForEach

func (obj *Object) ForEach(fn func(string, *Object))

func (*Object) ForEachArray

func (obj *Object) ForEachArray(fn func(string, *Array))

func (*Object) Get

func (obj *Object) Get(key string) interface{}

func (*Object) GetArray

func (obj *Object) GetArray(key string) *Array

func (*Object) GetByKeys

func (obj *Object) GetByKeys(keyStr string) interface{}

func (*Object) GetObject

func (obj *Object) GetObject(key string) *Object

func (*Object) ToString added in v1.0.4

func (obj *Object) ToString() string

Jump to

Keyboard shortcuts

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