validator

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModelError

func ModelError(errs []ValidationError) map[string]string

func New

func New() core.Validator

Types

type PlaygroundValidator

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

func NewPlayground added in v0.0.25

func NewPlayground() PlaygroundValidator

func (PlaygroundValidator) Validate

func (val PlaygroundValidator) Validate(target interface{}) ([]ValidationError, error)

type ValidationError

type ValidationError struct {
	// Tag is the condition that have failed
	Tag string

	// Complete path to the field that have the error.
	Path string

	// Field is the name (and only the name) of the failing field
	Field string

	// Error is the stringified error
	Err string

	Value interface{}
	Kind  reflect.Kind
}

func (ValidationError) Error

func (v ValidationError) Error() string

Jump to

Keyboard shortcuts

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