validatex

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailfastValidate

func FailfastValidate(validator *validator, data map[string]interface{}, rules []string, autoPanic ...bool) string

func FailfastValidateByStruct

func FailfastValidateByStruct(validator *validator, arg0 interface{}, rules []string, autoPanic ...bool) string

func NewValidator

func NewValidator() *validator

func Validate

func Validate(validator *validator, data map[string]interface{}, rules []string, autoPanic ...bool) map[string]string

func ValidateByStruct

func ValidateByStruct(validator *validator, arg0 interface{}, rules []string, autoPanic ...bool) map[string]string

Types

type RuleChecker

type RuleChecker interface {
	GetRuleName() string
	Check(value string, checkValue ...string) bool
}

type ValidateException

type ValidateException struct {
	// contains filtered or unexported fields
}

func NewValidateExceptionWithErrorTips

func NewValidateExceptionWithErrorTips(errorTips string) ValidateException

func NewValidateExceptionWithErrors

func NewValidateExceptionWithErrors(errors map[string]string) ValidateException

func (ValidateException) Error

func (ex ValidateException) Error() string

func (ValidateException) GetErrors

func (ex ValidateException) GetErrors() map[string]string

func (ValidateException) IsFailfast

func (ex ValidateException) IsFailfast() bool

Jump to

Keyboard shortcuts

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