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.
Click to show internal directories.
Click to hide internal directories.