Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LegacyAliasResolver ¶
type LegacyAliasResolver func(field reflect.StructField) (aliases []string, skip bool, err error)
LegacyAliasResolver resolves the legacy container aliases that older helper surfaces used when anonymous embedded structs were encoded as nested maps.
When skip is true, no legacy container aliases are recorded for the field. This is useful for callers that treat tag-based skips (for example "-") as ineligible for compatibility lookup while still wanting the promoted leaf fields themselves to remain visible.
type LegacyContainerPlan ¶
type LegacyContainerPlan struct {
IndexPath []int
Aliases []string
Field reflect.StructField
}
LegacyContainerPlan records one anonymous embedded struct container on the path to a promoted visible field, along with the aliases legacy helper surfaces used for nested compatibility lookups.
type VisibleFieldPlan ¶
type VisibleFieldPlan struct {
IndexPath []int
LegacyContainers []LegacyContainerPlan
Field reflect.StructField
}
VisibleFieldPlan describes one exported visible field on a struct, including promoted fields that arrived through exported anonymous embedded structs. Anonymous struct containers themselves are intentionally omitted.
func BuildVisibleFieldPlan ¶
func BuildVisibleFieldPlan(modelType reflect.Type, aliasResolver LegacyAliasResolver) ([]VisibleFieldPlan, error)
BuildVisibleFieldPlan enumerates exported visible fields for a struct using Go promotion rules. Promoted fields are included only when they arrive through exported anonymous embedded structs, matching TableTheory's current metadata recursion scope. Anonymous struct containers themselves are omitted.