validator

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: AGPL-3.0, AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateValuer

func ValidateValuer(field reflect.Value) interface{}

ValidateValuer implements validator.CustomTypeFunc

Types

type Validator

type Validator struct {
	Validator  *validator.Validate // валидатор для проверки структуры
	Translator ut.Translator       // переводчик
	Meta       *_meta.Meta         // метаданные на которых работает валидатор
	// contains filtered or unexported fields
}

func NewValidator

func NewValidator(meta *_meta.Meta, applyEntityRule bool) (*Validator, error)

NewValidator - создать новый валидатор и переводчик

func (*Validator) GetFieldDisplayName

func (v *Validator) GetFieldDisplayName(entityName string, fieldName string) string

func (*Validator) GetFieldFullName

func (v *Validator) GetFieldFullName(entityName string, fieldName string) string

func (*Validator) RegisterValidationRules

func (v *Validator) RegisterValidationRules(rules map[string]string, types interface{})

func (*Validator) ValidateObject

func (v *Validator) ValidateObject(externalId uint64, row *_meta.Object) (err error)

func (*Validator) ValidateStruct

func (v *Validator) ValidateStruct(externalId uint64, val any) (err error)

Jump to

Keyboard shortcuts

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