Documentation
¶
Overview ¶
Package validate provides composable validation helpers for Go with fluent builders, rule tags, and struct validation. It includes optional message translation support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateStruct ¶ added in v3.0.3
ValidateStruct validates a struct using v (or a fresh instance).
Types ¶
type BoolBuilder ¶
type BoolBuilder = glue.BoolBuilder
type CustomTypeBuilder ¶ added in v3.0.3
type CustomTypeBuilder = glue.CustomTypeBuilder
type IntBuilder ¶
type IntBuilder = glue.IntBuilder
type SliceBuilder ¶
type SliceBuilder = glue.SliceBuilder
type StringBuilder ¶
type StringBuilder = glue.StringBuilder
type Validate ¶
Re-export types for a developer-friendly root facade.
func New ¶
func New() *Validate
New returns a Validate configured with sensible defaults.
Defaults: - Installs default English translations via SimpleTranslator. - Registers built-in plugins (email, ulid, uuid) via blank imports.
func NewBare ¶
func NewBare() *Validate
NewBare returns a Validate without installing a default translator. Useful for advanced setups that manage translations differently.
func NewWithTranslator ¶
func NewWithTranslator(tr translator.Translator) *Validate
NewWithTranslator returns a Validate configured with the provided translator while keeping other defaults.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package core provides the main validation engine and fluent builder APIs.
|
Package core provides the main validation engine and fluent builder APIs. |
|
Package errors provides error types and error handling utilities for validation.
|
Package errors provides error types and error handling utilities for validation. |
|
Package examples provides examples for the validate package.
|
Package examples provides examples for the validate package. |
|
Package structvalidator provides struct validation functionality using reflection.
|
Package structvalidator provides struct validation functionality using reflection. |
|
Package translator provides internationalization support for validation messages.
|
Package translator provides internationalization support for validation messages. |
|
Package types provides the core validation engine types and rule system.
|
Package types provides the core validation engine types and rule system. |
|
Package validators provides built-in validation rules and plugin architecture.
|
Package validators provides built-in validation rules and plugin architecture. |
|
email
Package email provides email address validation as a plugin.
|
Package email provides email address validation as a plugin. |
|
ulid
Package ulid provides ULID validation as a plugin.
|
Package ulid provides ULID validation as a plugin. |
|
uuid
Package uuid provides UUID validation as a plugin.
|
Package uuid provides UUID validation as a plugin. |