validation

package
v0.0.0-...-e48215e Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DerivationPath

func DerivationPath(structValidator binding.StructValidator)

func JSONFields

func JSONFields(structValidator binding.StructValidator)

JSONFields adds a function to retrieve JSON tag names on StructValidator errors. It is mostly used alongside gin.

func MissingFields

func MissingFields(err error, fieldName bool) []string

MissingFields returns a slice of strings containing the names of the fields marked as required and not provided, extrapolated by err as validator.ValidationErrors. If fieldName is true, the JSON tag name will be provided instead of the struct field name. If err is not of the validator.ValidationErrors kind, a nil slice will be returned.

func MissingFieldsErr

func MissingFieldsErr(err error, fieldName bool) error

MissingFieldsErr formats the output of MissingFields in an error. If err is not of the validator.ValidationErrors kind, the original error will be returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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