Documentation ¶
Index ¶
- Variables
- func ForEachField(target any, fn FieldHandler, options ...forEachFieldOption) (err error)
- func GetSliceElementType(slice any) (reflect.Type, error)
- func IsFieldExported(fieldType reflect.StructField) bool
- func SliceContains(slice any, target any) bool
- func ToWriteableSliceValue(slicePointer any) (*reflect.Value, error)
- type FieldContext
- type FieldHandler
- type Iterator
- type ItrExitValidator
- type ItrMapper
- type ItrReducer
- type SlicePtrReflector
- type Spawner
Constants ¶
This section is empty.
Variables ¶
View Source
var ForEachFieldOptions = &forEachFieldConfig{}
Functions ¶
func ForEachField ¶
func ForEachField(target any, fn FieldHandler, options ...forEachFieldOption) (err error)
func IsFieldExported ¶
func IsFieldExported(fieldType reflect.StructField) bool
IsFieldExported returns whether a field are exported @see go/src/reflect/type.go reflect.StructField
func SliceContains ¶
Types ¶
type FieldContext ¶
type FieldContext struct { Value *reflect.Value reflect.StructField Path string }
type FieldHandler ¶
type FieldHandler func(ctx FieldContext) error
type SlicePtrReflector ¶
type SlicePtrReflector struct {
// contains filtered or unexported fields
}
func NewSlicePtrReflector ¶
func NewSlicePtrReflector(slicePtr any) (*SlicePtrReflector, error)
func (*SlicePtrReflector) ItemType ¶
func (ptrRef *SlicePtrReflector) ItemType() reflect.Type
func (*SlicePtrReflector) Len ¶
func (ptrRef *SlicePtrReflector) Len() int
func (*SlicePtrReflector) Ptr ¶
func (ptrRef *SlicePtrReflector) Ptr() int
Click to show internal directories.
Click to hide internal directories.