validation

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ErrTypeCastToValErrs = "could not type cast validation errors from"

ErrTypeCastToValErrs tells that incoming error is not convertible to validator.ValidationErrors

Variables

This section is empty.

Functions

This section is empty.

Types

type Validator

type Validator struct {
	*validator.Validate
}

Validator is a composition struct that uses external validator as a base and expands it by additional methods.

func New

func New() *Validator

New returns new instance of our custom validator.

func (Validator) MapFromValidationErrors

func (v Validator) MapFromValidationErrors(vErr error) (map[string]string, error)

MapFromValidationErrors returns map of fields and validation violations on those fields.

Jump to

Keyboard shortcuts

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