reflection

package
v1.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExistsInArray

func ExistsInArray(value string, arr []string) bool

ExistsInArray Returns true if value exists in arr, false otherwise

func FilterStructByFields

func FilterStructByFields(in interface{}, out interface{}, includedFields []string) (err error)

FilterStructByFields Returns a copy of the same struct with only the includedFields, or the a copy if the fields passed are nil

func GetJSONToFieldsMap

func GetJSONToFieldsMap(structEntity interface{}) map[string]string

GetJSONToFieldsMap returns a map from JSON field to struct field name

func StructFieldMatchesValue

func StructFieldMatchesValue(structEntity interface{}, field string, value interface{}) (matches bool, err error)

StructFieldMatchesValue Returns whether a struct entity's given field matches a certain value If it's an array, is returns whether the array's members are a subset of the field's array members else, they are compared by a == operator Returns true if value is nil Returns an error in case of errors in reflection or if values are of different types

Types

This section is empty.

Jump to

Keyboard shortcuts

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