validation

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: BSD-3-Clause Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, register RuleRegister)

Types

type RuleRegister

type RuleRegister func(attribute string, r contracts.InputSource, args ...string) (rule.Rule, error)

type ValidateError

type ValidateError map[string][]string

func (ValidateError) Error

func (v ValidateError) Error() string

func (ValidateError) StatusCode

func (v ValidateError) StatusCode() int

type Validator

type Validator struct {
	// contains filtered or unexported fields
}
var DefaultValidator *Validator

func (*Validator) GetRule

func (v *Validator) GetRule(name string) (RuleRegister, bool)

func (*Validator) Passes

func (v *Validator) Passes(req contracts.InputSource, attribute string, rules []string) (errors []string)

func (*Validator) PassesRules

func (v *Validator) PassesRules(req contracts.InputSource, attribute string, rules []interface{}) (errors []string)

func (*Validator) Register

func (v *Validator) Register(name string, register RuleRegister)

type WithValidation

type WithValidation interface {
	Rules() map[string][]interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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