validator

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: BSD-3-Clause Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() func(val string, field reflect.StructField, cfg interface{}) error

New returns a validation function to be applied on all flag struct fields of your command tree. It makes use of a singleton validator object, not exposed for customizations. If you want to add some validations or make any other customizations on the validator, use NewWith(custom) method.

func NewWith

func NewWith(custom *validator.Validate) func(val string, field reflect.StructField, cfg interface{}) error

NewWith returns a validation function to be applied on all flag struct fields. It takes a go-playground/validator object (meant to be used as a singleton), on which the user can prealably register any custom validation routines.

Types

This section is empty.

Directories

Path Synopsis
Package govalidator adds support for govalidator library.
Package govalidator adds support for govalidator library.

Jump to

Keyboard shortcuts

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