Documentation ¶
Index ¶
- func ForEachField(o interface{}, excludePrivateField bool, f FieldAcceptor) error
- func ForEachFieldV2(t reflect.Type, v reflect.Value, excludePrivateField bool, f FieldAcceptor) error
- func Id(c any) string
- func Interfaces2Values(o []any) []reflect.Value
- func IsImplement(instance any, _interface any) bool
- func IsTypeImplement(typ reflect.Type, _interface any) bool
- func New(t reflect.Type) reflect.Value
- func Set(dst, src reflect.Value)
- func TryCallMethod(b interface{}, methodName string, args ...any) []reflect.Value
- func TypeId(p reflect.Type) string
- func Values2Interfaces(values []reflect.Value) []any
- func WalkField(o interface{}, f FieldWalkAcceptor) error
- func WalkFieldV2(t reflect.Type, v reflect.Value, f FieldWalkAcceptor) error
- type FieldAcceptor
- type FieldWalkAcceptor
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForEachField ¶
func ForEachField(o interface{}, excludePrivateField bool, f FieldAcceptor) error
func ForEachFieldV2 ¶
func Interfaces2Values ¶
func IsImplement ¶
func TryCallMethod ¶
func Values2Interfaces ¶
func WalkField ¶
func WalkField(o interface{}, f FieldWalkAcceptor) error
WalkField walk the struct field with DFS, and break when meeting the nil pointer value, can be checked by value.Elem().InValid()
func WalkFieldV2 ¶
Types ¶
type FieldAcceptor ¶
type FieldAcceptor func(field reflect.StructField, value reflect.Value) error
type FieldWalkAcceptor ¶ added in v1.2.0
Click to show internal directories.
Click to hide internal directories.