validation

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidationErrorObject

type ValidationErrorObject struct {
	Message string `json:"message"`
	Field   string `json:"field"`
	Code    string `json:"code"`
}

type ValidationErrorsObject

type ValidationErrorsObject struct {
	Message string                  `json:"message"`
	Errors  []ValidationErrorObject `json:"errors"`
}

type Validator

type Validator struct {
	*validator.Validate
}

func NewValidation

func NewValidation() *Validator

func (*Validator) ValidateRequest

func (v *Validator) ValidateRequest(request interface{}) (*ValidationErrorsObject, error)

validates an incoming request and returns nil, nil if request is valid if an error occurred, it is an internal validation error and not a validation issue of the request

Jump to

Keyboard shortcuts

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