Documentation
¶
Overview ¶
Package validation constructs the framework's shared go-playground validator instance. It is the framework's only construction site, so server and messaging start from the same custom-rule set. It does not freeze that set: server.Validator() hands out the live instance, so anything registered through it afterwards applies to HTTP alone.
SECURITY: as of validator v10.30.3 all four name accessors on a FieldError — Namespace, StructNamespace, Field and StructField — derive from one string built with map keys interpolated verbatim, so a namespace from a dived map embeds payload data. Redact the bracketed span before logging one; the messaging package's PayloadError.Fields does exactly that.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns a validator with the framework's custom rules registered. The panic is unreachable today — RegisterValidation errors only on an empty tag name or a nil function, and every registration below is a static pair of both. It stays as a fail-fast in case that contract changes, since returning a half-configured instance would silently skip the rule at every call site.
Types ¶
This section is empty.