Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterDefaultValidationRules ¶
func RegisterDefaultValidationRules()
RegisterDefaultValidationRules registers the default validation rules provided by the package.
func RegisterValidationRule ¶
func RegisterValidationRule(name string, validateFunc ValidationRule)
RegisterValidationRule registers a custom validation rule with a given name and validation function.
func ValidateStruct ¶
ValidateStruct validates a struct based on the specified validation tags and language. It returns an error if validation fails or if any required input is missing.
Types ¶
type ValidationRule ¶
ValidationRule represents a function type for custom validation rules. It takes the field value to be validated, error messages, field name, and tag as input, and returns an error if validation fails.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.