validation

package
v0.30.0-dev.7 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validator

func Validator() *validator.Validate

Validator returns the validator instance for the application.

Types

type ValidationError

type ValidationError struct {
	Field string `json:"field"`
	Err   string `json:"error"`
}

func ValidateStruct

func ValidateStruct(request any) []ValidationError

ValidateStruct is a helper function for validating requests using the validator package. If the request is nil, it will return nil. If the request is valid, it will return an empty slice of ValidationErrors. If the request is invalid, it will return a slice of ValidationErrors containing the validation errors for each field.

func (ValidationError) Error

func (e ValidationError) Error() string

Jump to

Keyboard shortcuts

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