validator

package module
v0.0.0-...-e158ad5 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: MIT Imports: 4 Imported by: 0

README

Struct validator

Build Status codecov.io Code Coverage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterValidator

func RegisterValidator(name string, handler ValidatorHandler)

RegisterValidator maps a validator by name to a corrosponding handler. These handlers should not mutate any global data as these handlers run in parallel.

Types

type Errors

type Errors map[string][]error

Errors represents the validation errors

func Validate

func Validate(model interface{}) Errors

Validate runs the validations on a specific models in parallel

type ValidatorHandler

type ValidatorHandler func(reflect.StructField, reflect.Value) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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