validator

package
v0.0.0-...-128b944 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFieldErrors

func NewFieldErrors(err error) error

NewFieldErrors returns an error of type FieldErrors.

func ValidateStruct

func ValidateStruct(structPtr interface{}, fields ...*validation.FieldRules) error

ValidateStruct is a wrapper around validation.ValidateStruct that transforms validation.Errors to FieldErrors.

Types

type FieldError

type FieldError struct {
	Name string
	Err  error
}

FieldError hold the attributes for a single field error.

func (FieldError) Error

func (fe FieldError) Error() string

type FieldErrors

type FieldErrors []FieldError

FieldErrors is a collection of field error.

func (FieldErrors) Error

func (fes FieldErrors) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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