inspect

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(i1 interface{}, i2 interface{}) error

func ConvertJSON added in v0.6.0

func ConvertJSON(b []byte) (map[string]interface{}, error)

func GetObjectArray

func GetObjectArray(obj interface{}, prop string) ([]map[string]interface{}, error)

func GetObjectProp added in v1.0.1

func GetObjectProp(obj interface{}, prop string) (reflect.Value, error)

func GetObjectPropBool

func GetObjectPropBool(obj interface{}, prop string, defaultVal bool) (bool, error)

func GetObjectPropString

func GetObjectPropString(ctx context.Context, obj interface{}, prop string) (string, error)

func GetRawObjectPropString added in v0.3.3

func GetRawObjectPropString(obj interface{}, prop string) (string, error)

func GetStringArray

func GetStringArray(obj interface{}, prop string) ([]string, error)

func InspectStrings

func InspectStrings(i interface{}, handler stringHandler) (interface{}, error)

func Merge added in v1.1.0

func Merge(a, b map[string]interface{}) map[string]interface{}

Merge combines two maps. Keys in the second map override the ones in the first. Arrays are merged.

func SetObjectProp

func SetObjectProp(obj map[string]interface{}, prop string, value interface{}) error

func Source

func Source(i interface{}, settings map[string]interface{}) error

Source will copy values from settings to the given interface for all fields that are setup with json serialization in i. It's a shallow copy and i needs to be a struct or a pointer to a struct.

func UpsertInSlice

func UpsertInSlice(obj map[string]interface{}, prop string, value interface{}, f func(elem interface{}) bool) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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