Documentation ¶
Index ¶
- func Register(name string, register RuleRegister)
- type RuleRegister
- type ValidateError
- type Validator
- func (v *Validator) GetRule(name string) (RuleRegister, bool)
- func (v *Validator) Passes(req contracts.InputSource, attribute string, rules []string) (errors []string)
- func (v *Validator) PassesRules(req contracts.InputSource, attribute string, rules []interface{}) (errors []string)
- func (v *Validator) Register(name string, register RuleRegister)
- type WithValidation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name string, register RuleRegister)
Types ¶
type RuleRegister ¶
type ValidateError ¶
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) 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{}
}
Click to show internal directories.
Click to hide internal directories.