pkg

package
v0.0.0-...-7a2aee4 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidationErrDetail

type ValidationErrDetail struct {
	Field   string      `json:"field"`
	Value   interface{} `json:"value"`
	Message string      `json:"message"`
}

ValidationErrDetail represents detailed information about a validation error. It includes the field name, the value that failed validation, and a message explaining the error.

func NewValidationErrorDetails

func NewValidationErrorDetails(field, message string, value interface{}) []*ValidationErrDetail

NewValidationErrorDetails returns ValidationErrDetail list with given validation errors

func ValidationErrorDetails

func ValidationErrorDetails(obj interface{}, tag string, errs validator.ValidationErrors) []*ValidationErrDetail

ValidationErrorDetails processes validation errors and returns a slice of ValidationErrDetail. It takes three parameters: - obj: The instance of the object being validated. - tag: The tag used to identify validation tags in struct fields. - errs: The validation errors returned by the validator.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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