validation

package
v0.0.0-...-4b56e16 Latest Latest
Warning

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

Go to latest
Published: May 11, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error .

func NewError

func NewError(err error, validator SelfValidator) *Error

NewError constructor.

func (*Error) Error

func (e *Error) Error() string

Error returns error message.

func (*Error) GetError

func (e *Error) GetError() error

GetError returns validation error.

func (*Error) GetValidator

func (e *Error) GetValidator() SelfValidator

GetValidator returns validator.

type ErrorsConverter

type ErrorsConverter interface {
	// ConvertValidationErrors to field - message format.
	ConvertValidationErrors(err error, validator SelfValidator) *FieldsErrors
}

ErrorsConverter interface for requests validators.

type FieldError

type FieldError struct {
	Field   string `json:"field"`
	Message string `json:"message"`
}

FieldError for single field.

type FieldsErrors

type FieldsErrors struct {
	Errors []FieldError `json:"errors"`
}

FieldsErrors is a set of messages for every invalid field.

type OzzoErrorsConverter

type OzzoErrorsConverter struct{}

OzzoErrorsConverter converts ozzo-validation errors into valid meta.

func (*OzzoErrorsConverter) ConvertValidationErrors

func (c *OzzoErrorsConverter) ConvertValidationErrors(err error, validator SelfValidator) *FieldsErrors

ConvertValidationErrors to field - message format.

type SelfValidator

type SelfValidator interface {
	Validate() error
}

SelfValidator interface for json requests.

type ServiceProvider

type ServiceProvider struct{}

ServiceProvider struct.

func (*ServiceProvider) Register

func (p *ServiceProvider) Register(application *larago.Application)

Register service.

Jump to

Keyboard shortcuts

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