validator

package
v0.6.14 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

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

func (d DefaultValidator) CheckValidations(validations *map[string][]error, code codes.Code) error

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

Jump to

Keyboard shortcuts

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