Documentation ¶
Index ¶
- func BaseKind(a any) reflect.Kind
- func FindFieldByTag(objValue reflect.Value, tagKey string, match func(tagVal string) bool) (reflect.Value, bool)
- func GetByAccessor[T any](accessor *Accessor, field string) (T, error)
- func GetField(objValue reflect.Value, field string) (any, error)
- func Indirect(a any) any
- func IndirectOrImplements(v reflect.Value, ifaceTypes ...reflect.Type) reflect.Value
- func IndirectType(t reflect.Type) reflect.Type
- func IndirectValue(v reflect.Value) reflect.Value
- func IsEmptyValue(v reflect.Value) bool
- func New[T any]() T
- func RangeArrayOrSlice(obj any) ([]any, error)
- func RangeFields(objValue reflect.Value) (map[string]any, error)
- func RangeMap(obj any) ([]any, []any, error)
- func SetByAccessor[T any](accessor *Accessor, field string, val T) error
- func SetField(objValue reflect.Value, field string, newValue any) error
- type Accessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindFieldByTag ¶
func FindFieldByTag(objValue reflect.Value, tagKey string, match func(tagVal string) bool) (reflect.Value, bool)
FindFieldByTag searches through the fields of a given struct value for a field that has a specific tag and whose tag value satisfies a given condition. It returns the reflect.Value of the matched field along with a boolean indicating whether a match was found.
Parameters:
v: The reflect.Value representing the struct to search. tagKey: The key of the tag to look for. match: A function that takes the tag value as a string and returns true if it satisfies the condition.
Returns:
A tuple containing the reflect.Value of the matched field and a boolean indicating if a match was found.
func Indirect ¶
Indirect returns the value, after dereferencing as many times as necessary to reach the base type (or nil). From html/template/content.go Copyright 2011 The Go Authors. All rights reserved.
func IndirectOrImplements ¶
func IsEmptyValue ¶
func RangeArrayOrSlice ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.