Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(d EntityDescriptor)
Register adds a descriptor to the global registry. Panics on empty Kind or duplicate Kind.
Types ¶
type EntityDescriptor ¶
type EntityDescriptor struct {
Kind string // discriminator value stored in Resource.Kind
Plural string // URL path segment, e.g. "channels"
ParentKind string // "" for top-level entities
SpecSchemaName string // OpenAPI component name for spec validation
OnParentDelete OnParentDeletePolicy // only meaningful when ParentKind != ""
SearchDisallowedFields []string // fields blocked from TSL search
}
EntityDescriptor defines everything specific to a HyperFleet entity type. Descriptors are registered at startup via Register() in plugin init() functions.
func ChildrenOf ¶
func ChildrenOf(parentKind string) []EntityDescriptor
ChildrenOf returns descriptors whose ParentKind matches the given kind.
func Get ¶
func Get(entityKind string) (EntityDescriptor, bool)
Get returns a descriptor by Kind, or (zero, false) if not found.
func MustGet ¶
func MustGet(entityKind string) EntityDescriptor
MustGet returns a descriptor by Kind. Panics if not found.
type OnParentDeletePolicy ¶
type OnParentDeletePolicy string
OnParentDeletePolicy determines child behavior when its parent is deleted.
const ( OnParentDeleteRestrict OnParentDeletePolicy = "restrict" OnParentDeleteCascade OnParentDeletePolicy = "cascade" )
Click to show internal directories.
Click to hide internal directories.