reflection

package
v0.1.58 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

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 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 any, name string) []reflect.Value

func IsMapOfStringToPtrToStruct

func IsMapOfStringToPtrToStruct(type_ reflect.Type) bool

Compatible with map[string]*struct{}

func IsNil

func IsNil(value reflect.Value) bool

func IsPtrToBool

func IsPtrToBool(value any) bool

*bool

func IsPtrToFloat64

func IsPtrToFloat64(value any) bool

*float64

func IsPtrToInt64

func IsPtrToInt64(value any) bool

*int64

func IsPtrToMapOfStringToString

func IsPtrToMapOfStringToString(value any) bool

*map[string]string

func IsPtrToSliceOfString

func IsPtrToSliceOfString(value any) bool

*[]string

func IsPtrToString

func IsPtrToString(value any) bool

*string

func IsPtrToStruct

func IsPtrToStruct(type_ reflect.Type) bool

Compatible with *struct{}

func IsSliceOfPtrToStruct

func IsSliceOfPtrToStruct(type_ reflect.Type) bool

Compatible with []*struct{}

func TraverseEntities added in v0.1.51

func TraverseEntities(entity any, locking bool, traverse EntityTraverser)

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

Types

type EntityTraverser added in v0.1.51

type EntityTraverser func(any) bool

type EntityWork added in v0.1.52

type EntityWork map[any]struct{}

func (EntityWork) Start added in v0.1.52

func (self EntityWork) Start(entityPtr any) bool

func (EntityWork) TraverseEntities added in v0.1.52

func (self EntityWork) TraverseEntities(entityPtr any, traverse EntityTraverser)

Jump to

Keyboard shortcuts

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