Documentation ¶
Overview ¶
Package validation provides methods to validate the various models for this project.
Index ¶
- Variables
- func IsEmptyString(in string) bool
- func IsValidEmail(email string) bool
- func IsValidForum(forum *pb.Forum) error
- func IsValidPassword(s string) bool
- func IsValidPlace(place *pb.Place) error
- func IsValidPost(post *pb.Post) error
- func IsValidSignUp(user *pb.User) error
- func IsValidThread(thread *pb.Thread) error
- func NormalizeEmail(email string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyUid error for empty uid ErrEmptyUid = errors.New("uid cannot be empty") // 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") // ErrEmptyTitle error for empty Title ErrEmptyTitle = errors.New("title cannot be empty") // ErrEmptyDescription error for empty Description ErrEmptyDescription = errors.New("description cannot be empty") // ErrEmptyMsg error for empty Msg ErrEmptyMsg = errors.New("message 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("resource not found") // ErrInvalidPassword error for invalid password ErrInvalidPassword = errors.New("invalid password, 8-50 characters, one upper, lower, number and special character") )
Functions ¶
func IsValidForum ¶
IsValidForum verifies the given forum is valid.
func IsValidPassword ¶
IsValidPassword verifies if a password is valid
func IsValidPlace ¶
IsValidPlace verifies the given place is valid.
func IsValidPost ¶
IsValidPost verifies the given post is valid.
func IsValidSignUp ¶
IsValidSignUp takes a *SignUpRequest and verifies if the request is valid
func IsValidThread ¶
IsValidThread verifies the given thread is valid.
func NormalizeEmail ¶
NormalizeEmail normalizes email string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.