validator

package
v0.106.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultValidator *vv9.Validate
)

Functions

func NewDefaultValidator

func NewDefaultValidator() *vv9.Validate

func RegisterCustomValidator

func RegisterCustomValidator(fn vv9.CustomTypeFunc, types ...interface{})

func RegisterStructLevel

func RegisterStructLevel(fn vv9.StructLevelFunc, types ...interface{})

func Validate

func Validate(v interface{}) error

Validate validates the fields of a struct based on 'validator' tags and returns errors found indexed by the field name.

Types

type Validator

type Validator interface {
	Validate() error
}

Validator values have a Validate() method returning nil iff the value is deemed valid.

Jump to

Keyboard shortcuts

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