utils

package
v0.0.0-...-4c09e60 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPassword

func CheckPassword(hash, pass string) error

CheckPassword is the util that use bcrypt package to check password with hash return nil for success and nil for failure

func ExtractPhone

func ExtractPhone(c *gin.Context) string

ExtractPhone extract phone from jwt payload

func GeneratePassword

func GeneratePassword(passwd string) ([]byte, error)

GeneratePassword is the util that use bcrypt package to generage password hash

func ValidBirthday

func ValidBirthday(birth string) bool

ValidBirthday is the utility that check the validation of birthday

func ValidEmail

func ValidEmail(email string) bool

ValidEmail is the util that check the validation of email

func ValidName

func ValidName(name string) bool

ValidName is the util that check the validation of username length is between 4 to 16 and all number are forbidden

func ValidPassword

func ValidPassword(pw string) bool

ValidPassword is the util that check the validation of password

func ValidPhone

func ValidPhone(phone string) bool

ValidPhone is the util that check the phone

Types

This section is empty.

Directories

Path Synopsis
e
Package e is the custom error package that provide function to generate Err with code and message
Package e is the custom error package that provide function to generate Err with code and message

Jump to

Keyboard shortcuts

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