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 SetAnyValueFromString(t reflect.Type, value reflect.Value, val string, itps ...Interceptor) error
- func SetValue(value reflect.Value, setter func(a any) error) error
- 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
- func ZeroValue(p reflect.Type) any
- type FieldAcceptor
- type FieldWalkAcceptor
- type Interceptor
- type Node
- type SetValueHandler
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 SetAnyValueFromString ¶ added in v1.5.0
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
type Interceptor ¶ added in v1.5.0
type Interceptor map[reflect.Kind]SetValueHandler
type Node ¶ added in v1.2.0
type Node struct { Parent *Node Field reflect.StructField Value reflect.Value }
type SetValueHandler ¶ added in v1.5.0
Click to show internal directories.
Click to hide internal directories.