validation

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: MIT Imports: 4 Imported by: 0

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(r contracts.RequestContract, args ...string) rule.Rule

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.RequestContract, attribute string, input interface{}, 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