reflection

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: Apache-2.0 Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFieldTagsForType

func GetFieldTagsForType(type_ reflect.Type, name string) map[string]string

func GetFieldTagsForValue

func GetFieldTagsForValue(value reflect.Value, name string) map[string]string

func GetFunctionName

func GetFunctionName(fn interface{}) string

See: https://stackoverflow.com/a/7053871/849021

func GetReferredField

func GetReferredField(entity reflect.Value, referenceFieldName string, referredFieldName string) (reflect.Value, reflect.Value, bool)

func GetStructFields

func GetStructFields(type_ reflect.Type) []reflect.StructField

Includes fields "inherited" from anonymous struct pointer fields The order of field definition is important! Later fields will override previous fields

func GetTaggedFields

func GetTaggedFields(structPtr interface{}, name string) []reflect.Value

func IsMapOfStringToPtrToStruct

func IsMapOfStringToPtrToStruct(type_ reflect.Type) bool

Compatible with map[string]*interface{}

func IsNil

func IsNil(value reflect.Value) bool

func IsPtrToBool

func IsPtrToBool(value interface{}) bool

*bool

func IsPtrToFloat64

func IsPtrToFloat64(value interface{}) bool

*float64

func IsPtrToInt64

func IsPtrToInt64(value interface{}) bool

*int64

func IsPtrToMapOfStringToString

func IsPtrToMapOfStringToString(value interface{}) bool

*map[string]string

func IsPtrToSliceOfString

func IsPtrToSliceOfString(value interface{}) bool

*[]string

func IsPtrToString

func IsPtrToString(value interface{}) bool

*string

func IsPtrToStruct

func IsPtrToStruct(type_ reflect.Type) bool

Compatible with *interface{}

func IsSliceOfPtrToStruct

func IsSliceOfPtrToStruct(type_ reflect.Type) bool

Compatible with []*interface{}

func Traverse

func Traverse(object interface{}, traverse Traverser)

Ignore fields tagged with "traverse:ignore" or "lookup"

Types

type Traverser

type Traverser func(interface{}) bool

Jump to

Keyboard shortcuts

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