interfaces

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Validator

type Validator interface {
	// Struct validates a struct based on validation tags
	Struct(any) error
	// Var validates a single variable using a tag
	Var(any, string) error
	// RegisterValidation adds a custom validation with the given tag
	RegisterValidation(string, func(fl validator.FieldLevel) bool) error
	// RegisterStructValidation adds a struct-level validation
	RegisterStructValidation(func(sl validator.StructLevel), any) error
	// RegisterCrossFieldValidation adds a cross-field validation
	RegisterCrossFieldValidation(tag string, fn func(fl validator.FieldLevel) bool) error
	// GetValidationErrors returns detailed validation errors
	GetValidationErrors(err error) map[string]string
	// ValidateStruct is an alias for Struct for backward compatibility
	ValidateStruct(any) error
}

Validator defines the interface for validation operations

Jump to

Keyboard shortcuts

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