validator

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidationError

type ValidationError struct {
	// contains filtered or unexported fields
}

ValidationError - Errors for tags validation.

func NewValidationError

func NewValidationError(errors []*ValidationErrorResponse) *ValidationError

NewValidationError - ValidationError constructor.

func (*ValidationError) Error

func (v *ValidationError) Error() string

func (*ValidationError) GetErrorsDetails

func (v *ValidationError) GetErrorsDetails() []*ValidationErrorResponse

GetErrorsDetails - return the errors.

type ValidationErrorResponse

type ValidationErrorResponse struct {
	FailedField string
	Tag         string
	Value       string
}

ValidationErrorResponse - Struct for the validation error.

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator - Validator type.

func NewValidator

func NewValidator() *Validator

NewValidator - Create a new Validator.

func (*Validator) ValidateStruct

func (v *Validator) ValidateStruct(str interface{}) []*ValidationErrorResponse

ValidateStruct - apply validation.

Jump to

Keyboard shortcuts

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