validation

package
v0.0.0-...-df9f0db Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidationError

type ValidationError struct {
	Field  string   `json:"field"`
	Errors []string `json:"errors"`
}

type Validator

type Validator struct {
	ReflectValue reflect.Value
	Fields       []string
	Errors       map[string][]string
}

func NewValidator

func NewValidator(model interface{}) Validator

func (*Validator) CheckField

func (v *Validator) CheckField(fieldName string) error

func (*Validator) Email

func (v *Validator) Email(fieldName string) error

func (*Validator) MinLength

func (v *Validator) MinLength(fieldName string, length int) error

func (*Validator) NotBlank

func (v *Validator) NotBlank(fieldName string) error

func (*Validator) Summary

func (v *Validator) Summary() []ValidationError

Jump to

Keyboard shortcuts

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