reflection

package
v0.3.24 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 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 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 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 IsEmpty added in v0.1.62

func IsEmpty(value any) bool

func IsFloat added in v0.1.61

func IsFloat(kind reflect.Kind) bool

float64, float32

func IsInteger added in v0.1.61

func IsInteger(kind reflect.Kind) bool

int64, int32, int16, int8, int

func IsMapOfStringToPointerToStruct added in v0.1.61

func IsMapOfStringToPointerToStruct(type_ reflect.Type) bool

Compatible with map[string]*struct{}

func IsNil

func IsNil(value reflect.Value) bool

func IsPointerToBool added in v0.1.61

func IsPointerToBool(value any) bool

*bool

func IsPointerToFloat64 added in v0.1.61

func IsPointerToFloat64(value any) bool

*float64

func IsPointerToInt64 added in v0.1.61

func IsPointerToInt64(value any) bool

*int64

func IsPointerToMapOfStringToString added in v0.1.61

func IsPointerToMapOfStringToString(value any) bool

*map[string]string

func IsPointerToSliceOfString added in v0.1.61

func IsPointerToSliceOfString(value any) bool

*[]string

func IsPointerToString added in v0.1.61

func IsPointerToString(value any) bool

*string

func IsPointerToStruct added in v0.1.61

func IsPointerToStruct(type_ reflect.Type) bool

Compatible with *struct{}

func IsSliceOfPointerToStruct added in v0.1.61

func IsSliceOfPointerToStruct(type_ reflect.Type) bool

Compatible with []*struct{}

func IsUInteger added in v0.1.61

func IsUInteger(kind reflect.Kind) bool

uint64, uint32, uint16, uint8, uint

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