Documentation
¶
Overview ¶
Package formgen lowers captured form codecs into generated typed adapters. Callers supply physical declarations and selectors; this package never infers authored media policy from the generated Go representation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Application ¶
func Application(application httpencoding.Application) string
Application renders the already resolved codec application.
func Presence ¶
func Presence(context *codegen.AttributeContext, parent *expr.AttributeExpr, key string, physical *expr.AttributeExpr, value string) string
Presence renders the physical declaration's presence predicate. Empty values remain present; codec policy never follows Go wrapper shape inference.
Types ¶
type Access ¶
type Access struct {
// Values and Name identify the raw form map and encoded field name.
Values, Name string
// Value is the allocated Go selector, without an address operator.
Value string
// Presence is an optional physical presence expression for encoding.
Presence string
// Required rejects absent values or zero emitted items where keys are evidence.
Required bool
// ErrorPrefix supplies other return values before an error (for example "\"\", ").
ErrorPrefix string
// Label names the field in diagnostics.
Label string
}
Access supplies expressions at one emission site.
type Field ¶
type Field struct {
// Codec preserves the occurrence's style and value-versus-item application.
Codec httpencoding.Codec
// AllowsNull preserves explicit null admission for JSON values.
AllowsNull bool
}
Field binds a captured codec to one typed form value.
func (Field) DecodeCall ¶
DecodeCall renders one typed leaf decode without reflection-based policy inference.
func (Field) EncodeCall ¶
EncodeCall renders one JSON or native leaf call, retaining captured policy.