validation

package
v0.58.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 2 Imported by: 0

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

func New() *validator.Validate

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL