validator

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotStruct                   = errors.New("wrong argument given, should be a struct")
	ErrInvalidValidatorSyntax      = errors.New("invalid validator syntax")
	ErrValidateForUnexportedFields = errors.New("validation for unexported field is not allowed")
	ErrValidateForUnsupportedTypes = errors.New("validation for unsupported type is not allowed")
	ErrUnsupportedValidator        = errors.New("validator for this type is unsupported")
)

Functions

func Validate

func Validate(v any) error

Types

type ValidationError

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

func (ValidationError) Error

func (v ValidationError) Error() string

func (ValidationError) Field

func (v ValidationError) Field() string

func (ValidationError) Tag

func (v ValidationError) Tag() string

func (ValidationError) Value

func (v ValidationError) Value() any

type ValidationErrors

type ValidationErrors []ValidationError

func (ValidationErrors) Error

func (v ValidationErrors) Error() string

Jump to

Keyboard shortcuts

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