object

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2020 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterfaceWalk

func InterfaceWalk(obj interface{}, path interface{}) (val interface{}, has bool)

* quick get the val from a interface

Types

type Object

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

func NewInterfaceWalker

func NewInterfaceWalker(obj interface{}) *Object

func (*Object) GetBool

func (obj *Object) GetBool(path interface{}) bool

func (*Object) GetFloat

func (obj *Object) GetFloat(path interface{}, def ...float64) (val float64, has bool)

func (*Object) GetFloatSlice

func (obj *Object) GetFloatSlice(path interface{}, def ...[]float64) (val []float64, has bool)

func (*Object) GetInt

func (obj *Object) GetInt(path interface{}, def ...int) (val int, has bool)

func (*Object) GetIntSlice

func (obj *Object) GetIntSlice(path interface{}, def ...[]int) (val []int, has bool)

func (*Object) GetInterface

func (obj *Object) GetInterface(path interface{}) (val interface{}, has bool)

func (*Object) GetInterfaceSlice

func (obj *Object) GetInterfaceSlice(path interface{}, def ...[]interface{}) (val []interface{}, has bool)

func (*Object) GetObject

func (obj *Object) GetObject(path interface{}) (val *Object, has bool)

func (*Object) GetString

func (obj *Object) GetString(path interface{}, def ...string) (val string, has bool)

* 读取指定项的值

func (*Object) GetStringSlice

func (obj *Object) GetStringSlice(path interface{}, def ...[]string) (val []string, has bool)

func (*Object) GoInto

func (obj *Object) GoInto(path interface{})

Jump to

Keyboard shortcuts

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