Documentation ¶
Index ¶
- Variables
- type DefaultValidator
- func (d *DefaultValidator) CheckValidations(structFieldsValidations *commonvalidatorfields.StructFieldsValidations, ...) error
- func (d *DefaultValidator) ValidateBirthdate(birthdateField string, birthdate *timestamppb.Timestamp, ...)
- func (d *DefaultValidator) ValidateEmail(emailField string, email string, ...)
- func (d *DefaultValidator) ValidateNilFields(request interface{}, ...) (*commonvalidatorfields.StructFieldsValidations, error)
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var (
NilValidatorError = errors.New("validator cannot be nil")
)
Functions ¶
This section is empty.
Types ¶
type DefaultValidator ¶
type DefaultValidator struct{}
DefaultValidator struct
func NewDefaultValidator ¶
func NewDefaultValidator() *DefaultValidator
NewDefaultValidator creates a new default validator
func (*DefaultValidator) CheckValidations ¶
func (d *DefaultValidator) CheckValidations( structFieldsValidations *commonvalidatorfields.StructFieldsValidations, code codes.Code, ) error
CheckValidations checks if there are any validations
func (*DefaultValidator) ValidateBirthdate ¶
func (d *DefaultValidator) ValidateBirthdate( birthdateField string, birthdate *timestamppb.Timestamp, structFieldsValidations *commonvalidatorfields.StructFieldsValidations, )
ValidateBirthdate validates the birthdate field
func (*DefaultValidator) ValidateEmail ¶
func (d *DefaultValidator) ValidateEmail( emailField string, email string, structFieldsValidations *commonvalidatorfields.StructFieldsValidations, )
ValidateEmail validates the email address field
func (*DefaultValidator) ValidateNilFields ¶ added in v0.9.0
func (d *DefaultValidator) ValidateNilFields( request interface{}, structFieldsToValidate *commonvalidatorfields.StructFieldsToValidate, ) (*commonvalidatorfields.StructFieldsValidations, error)
ValidateNilFields validates the nil fields
type Validator ¶
type Validator interface { ValidateEmail( emailField string, email string, structFieldsValidations *commonvalidatorfields.StructFieldsValidations, ) ValidateBirthdate( birthdateField string, birthdate *timestamppb.Timestamp, structFieldsValidations *commonvalidatorfields.StructFieldsValidations, ) ValidateNilFields(request interface{}, structFieldsToValidate *commonvalidatorfields.StructFieldsToValidate) ( *commonvalidatorfields.StructFieldsValidations, error, ) CheckValidations(structFieldsValidations *commonvalidatorfields.StructFieldsValidations, code codes.Code) error }
Validator interface
Click to show internal directories.
Click to hide internal directories.