Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilMapper = errors.New("mapper cannot be nil") ErrNilValidator = errors.New("mapper validator cannot be nil") ErrFieldTagNameNotFound = "field tag name not found: %s" ErrFieldIsRequiredNotFound = "field is required not found: %s" ErrRequiredField = "%s is required" )
Functions ¶
This section is empty.
Types ¶
type DefaultValidator ¶
type DefaultValidator struct {
// contains filtered or unexported fields
}
DefaultValidator struct
func NewDefaultValidator ¶
func NewDefaultValidator( logger *Logger, ) *DefaultValidator
NewDefaultValidator creates a new default mapper validator
func (*DefaultValidator) IsFieldInitialized ¶ added in v0.5.5
func (d *DefaultValidator) IsFieldInitialized( fieldValue reflect.Value, ) (isInitialized bool)
IsFieldInitialized checks if a field is initialized
func (*DefaultValidator) ValidateRequiredFields ¶ added in v0.5.0
func (d *DefaultValidator) ValidateRequiredFields( rootStructValidations *govalidatormappervalidations.StructValidations, mapper *govalidatormapper.Mapper, ) error
ValidateRequiredFields validates the required fields of a struct
type Logger ¶ added in v0.4.6
type Logger struct {
// contains filtered or unexported fields
}
Logger is the structs mapper validator logger
func NewLogger ¶ added in v0.4.6
func NewLogger(header string, modeLogger gologgermode.Logger) (*Logger, error)
NewLogger creates a new structs mapper validator logger
type Validator ¶
type Validator interface { ValidateRequiredFields( rootStructValidations *govalidatormappervalidations.StructValidations, mapper *govalidatormapper.Mapper, ) (err error) }
Validator interface
Click to show internal directories.
Click to hide internal directories.