Documentation ¶
Index ¶
- type DefaultValidator
- func (d DefaultValidator) CheckValidations(validations *map[string][]error, code codes.Code) error
- func (d DefaultValidator) ValidateBirthdate(birthdateField string, birthdate *timestamppb.Timestamp, ...)
- func (d DefaultValidator) ValidateEmail(emailField string, email string, validations *map[string][]error)
- func (d DefaultValidator) ValidateNonEmptyStringFields(request interface{}, fieldsToValidate *map[string]string) *map[string][]error
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 ¶
CheckValidations checks if there are any validations
func (DefaultValidator) ValidateBirthdate ¶
func (d DefaultValidator) ValidateBirthdate(birthdateField string, birthdate *timestamppb.Timestamp, validations *map[string][]error)
ValidateBirthdate validates the birthdate field
func (DefaultValidator) ValidateEmail ¶
func (d DefaultValidator) ValidateEmail(emailField string, email string, validations *map[string][]error)
ValidateEmail validates the email address field
func (DefaultValidator) ValidateNonEmptyStringFields ¶
func (d DefaultValidator) ValidateNonEmptyStringFields(request interface{}, fieldsToValidate *map[string]string) *map[string][]error
ValidateNonEmptyStringFields validates the non-empty string fields
type Validator ¶
type Validator interface { ValidateEmail(emailField string, email string, validations *map[string][]error) ValidateBirthdate(birthdateField string, birthdate *timestamppb.Timestamp, validations *map[string][]error) ValidateNonEmptyStringFields(request interface{}, fieldsToValidate *map[string]string) *map[string][]error CheckValidations(validations *map[string][]error, code codes.Code) error }
Validator interface
Click to show internal directories.
Click to hide internal directories.