Documentation
¶
Overview ¶
Package ptrmap provides a function to collect pointers to struct fields from a given struct.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector is a struct that collects pointers to fields of a struct, excluding fields based on the provided predicates.
func DefaultCollector ¶
func DefaultCollector() *Collector
DefaultCollector returns a Collector with default exclusion rules.
func New ¶
func New(predicates ...ExcludePredicate) *Collector
New returns a new Collector with the given exclude predicates.
func (*Collector) AddExcludePredicate ¶
func (c *Collector) AddExcludePredicate(pred ExcludePredicate)
AddExcludePredicate adds an exclusion predicate to the Collector.
type ExcludePredicate ¶
type ExcludePredicate func(field reflect.StructField, value reflect.Value) bool
ExcludePredicate is a function type that defines a predicate for excluding fields from collection.
Click to show internal directories.
Click to hide internal directories.