validator

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Validation

type Validation interface {
	Validator(locale string) Validator
}

type ValidationError

type ValidationError struct {
	Message string   `json:"message" xml:"message"`
	Details []string `json:"details,omitempty" xml:"details,omitempty"`
	// contains filtered or unexported fields
}

ValidationError error object returned from validation.

func IsValidationError

func IsValidationError(err error) (ValidationError, bool)

IsValidationError function convert error as ValidationError.

func (ValidationError) Detail

func (ve ValidationError) Detail() map[string]string

Detail function to get map detail of ValidationError.

func (ValidationError) Error

func (ve ValidationError) Error() string

Error function implement error interface.

func (*ValidationError) SetDetail

func (ve *ValidationError) SetDetail(key, value string)

SetDetail function to set map detail of ValidationError.

type ValidationTranslation

type ValidationTranslation interface {
	Translator() locales.Translator
	Register(translator ut.Translator) error
}

type Validator

type Validator interface {
	Struct(s interface{}) error
}

Jump to

Keyboard shortcuts

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