Documentation
¶
Overview ¶
Package validatorgen compiles validator functions from resolved schemas.
Index ¶
- func BuildComplexTypePlan(sch *parser.Schema, registry *analysis.Registry) (*complextypeplan.Plan, error)
- func BuiltinTypeNames() []model.TypeName
- func CollectAttributeUses(schema *parser.Schema, ct *model.ComplexType) ([]*model.AttributeDecl, *model.AnyAttribute, error)
- type CompiledValidators
- func (c *CompiledValidators) AttrUseDefault(attr *model.AttributeDecl) (DefaultFixedValue, bool)
- func (c *CompiledValidators) AttrUseFixed(attr *model.AttributeDecl) (DefaultFixedValue, bool)
- func (c *CompiledValidators) AttributeDefault(id ids.AttrID) (DefaultFixedValue, bool)
- func (c *CompiledValidators) AttributeFixed(id ids.AttrID) (DefaultFixedValue, bool)
- func (c *CompiledValidators) ElementDefault(id ids.ElemID) (DefaultFixedValue, bool)
- func (c *CompiledValidators) ElementFixed(id ids.ElemID) (DefaultFixedValue, bool)
- func (c *CompiledValidators) ValidatorForType(typ model.Type) (runtime.ValidatorID, bool)
- type DefaultFixedValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildComplexTypePlan ¶ added in v0.0.25
func BuildComplexTypePlan(sch *parser.Schema, registry *analysis.Registry) (*complextypeplan.Plan, error)
BuildComplexTypePlan precomputes shared complex-type artifacts for compile/build phases.
func BuiltinTypeNames ¶
BuiltinTypeNames returns the deterministic builtin type compile order.
func CollectAttributeUses ¶
func CollectAttributeUses(schema *parser.Schema, ct *model.ComplexType) ([]*model.AttributeDecl, *model.AnyAttribute, error)
CollectAttributeUses resolves effective attribute uses and wildcard. It follows complex-type derivation from base to leaf in deterministic order.
Types ¶
type CompiledValidators ¶
type CompiledValidators struct {
TypeValidators map[ids.TypeID]runtime.ValidatorID
ValidatorByType map[model.Type]runtime.ValidatorID
SimpleContentTypes map[*model.ComplexType]model.Type
ComplexTypes *complextypeplan.Plan
Validators runtime.ValidatorsBundle
Enums runtime.EnumTable
Facets []runtime.FacetInstr
Patterns []runtime.Pattern
Values runtime.ValueBlob
// contains filtered or unexported fields
}
CompiledValidators contains all runtime validator artifacts generated from a schema.
func CompileWithComplexTypePlan ¶ added in v0.0.25
func CompileWithComplexTypePlan( sch *parser.Schema, registry *analysis.Registry, complexTypes *complextypeplan.Plan, ) (*CompiledValidators, error)
CompileWithComplexTypePlan compiles validators, optionally reusing a precomputed complex-type plan.
func (*CompiledValidators) AttrUseDefault ¶ added in v0.0.25
func (c *CompiledValidators) AttrUseDefault(attr *model.AttributeDecl) (DefaultFixedValue, bool)
AttrUseDefault returns the compiled default value for a specific attribute use.
func (*CompiledValidators) AttrUseFixed ¶ added in v0.0.25
func (c *CompiledValidators) AttrUseFixed(attr *model.AttributeDecl) (DefaultFixedValue, bool)
AttrUseFixed returns the compiled fixed value for a specific attribute use.
func (*CompiledValidators) AttributeDefault ¶ added in v0.0.25
func (c *CompiledValidators) AttributeDefault(id ids.AttrID) (DefaultFixedValue, bool)
AttributeDefault returns the compiled default value for an attribute declaration.
func (*CompiledValidators) AttributeFixed ¶ added in v0.0.25
func (c *CompiledValidators) AttributeFixed(id ids.AttrID) (DefaultFixedValue, bool)
AttributeFixed returns the compiled fixed value for an attribute declaration.
func (*CompiledValidators) ElementDefault ¶ added in v0.0.25
func (c *CompiledValidators) ElementDefault(id ids.ElemID) (DefaultFixedValue, bool)
ElementDefault returns the compiled default value for a global/local element.
func (*CompiledValidators) ElementFixed ¶ added in v0.0.25
func (c *CompiledValidators) ElementFixed(id ids.ElemID) (DefaultFixedValue, bool)
ElementFixed returns the compiled fixed value for a global/local element.
func (*CompiledValidators) ValidatorForType ¶ added in v0.0.25
func (c *CompiledValidators) ValidatorForType(typ model.Type) (runtime.ValidatorID, bool)
ValidatorForType returns the validator ID for a type when available.
type DefaultFixedValue ¶
type DefaultFixedValue struct {
Key runtime.ValueKeyRef
Ref runtime.ValueRef
Member runtime.ValidatorID
}
DefaultFixedValue stores canonical default/fixed metadata for runtime tables.
Source Files
¶
- attribute_uses_collect.go
- attribute_uses_merge.go
- attribute_uses_wildcard.go
- builtin_names.go
- compiler_build_orchestrate.go
- compiler_build_registry.go
- compiler_build_result.go
- compiler_canonicalize_atomic.go
- compiler_canonicalize_flow.go
- compiler_canonicalize_value.go
- compiler_compile_builtin.go
- compiler_compile_simple.go
- compiler_compile_type.go
- compiler_compile_typeid.go
- compiler_complex_plan.go
- compiler_core.go
- compiler_emit.go
- compiler_facets_collect.go
- compiler_facets_program.go
- compiler_facets_validation.go
- compiler_kindmap.go
- compiler_patterns.go
- default_fixed_set.go
- defaults_access.go
- defaults_attributes.go
- defaults_canonicalize.go
- defaults_elements.go
- defaults_enum.go
- defaults_orchestrate.go
- defaults_types.go
- defaults_value_types.go
- doc.go
- resolver_core.go
- resolver_helpers.go
- resolver_list_union.go
- resolver_properties.go
- resolver_variety.go
- shared_helpers.go
- value_keys_atomic.go
- value_keys_flow.go
- value_keys_key.go
- values.go