Documentation ¶
Index ¶
- func CheckPasswordHash(password, hash string) (bool, error)
- func GetCurDT(t time.Time, timeZone string) time.Time
- func GetIP(r *http.Request) string
- func HashAndSalt(pwd []byte) (string, error)
- func IsEmailValid(email string) bool
- func IsFileExist(filename string) bool
- func IsURLValid(strURL string) bool
- func IsUserNameValid(userName string) bool
- func LocalNow(tz string) time.Time
- func ParseFloatToString(strInt string, bitSize, decimals int) (string, error)
- func TimeParseToString(strDT, dateTimeFormat string) (string, error)
- func TrimQ(cleanStr string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
CheckPasswordHash compares the two passwords between the stored hash and the raw plain text password.
func GetCurDT ¶
GetCurDT gets the current system date and time with specified local timezone, e.g timeZone = "Asia/Manila".
func GetIP ¶
GetIP gets a requests IP address by reading off the forwarded-for header (for proxies) and falls back to use the remote address.
func HashAndSalt ¶
HashAndSalt is to hash user's password using bycrypt in Go.
func IsEmailValid ¶
IsEmailValid ensure the email is a valid email address.
func IsFileExist ¶ added in v1.0.4
IsFileExist checks if the file existed or not
func IsURLValid ¶
IsURLValid ensure that only a valid URL pattern will be accepted.
func IsUserNameValid ¶
IsUserNameValid ensure that only allowed special characters like @, ., +, -, and _.
func ParseFloatToString ¶ added in v1.0.2
ParseFloatToString parses any float value, options: bitSize either (32 or 64) with decimal value. Ideal for any pricing or financial amount values.
func TimeParseToString ¶ added in v1.0.2
TimeParseToString parses the time.Time with specific date and time format.
Types ¶
This section is empty.