Documentation ¶
Overview ¶
Package validation provides methods for validating various inputs
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyName error for empty name ErrEmptyName = errors.New("name cannot be empty") // ErrEmptyEmail error for empty email ErrEmptyEmail = errors.New("email cannot be empty") // ErrEmptyPassword error for empty password ErrEmptyPassword = errors.New("password cannot be empty") // ErrInvalidEmail error for invalid email ErrInvalidEmail = errors.New("email not valid") // ErrEmailExists error for email already exists ErrEmailExists = errors.New("email already exists") // ErrNameExists error for name already exists ErrNameExists = errors.New("name already exists") // ErrNotFound error for not found ErrNotFound = errors.New("user not found") // ErrInvalidPassword error for invalid password ErrInvalidPassword = errors.New("invalid password, 8-50 characters, one upper, lower, number and special character") )
Functions ¶
func IsValidPassword ¶
IsValidPassword verifies if a password is valid
func IsValidSignUp ¶
func IsValidSignUp(user *models.SignUpRequest) error
IsValidSignUp takes a *SignUpRequest and verifies if the request is valid
func NormalizeEmail ¶
NormalizeEmail normalizes email string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.