package
0.0.0-20240828184941-667ddf2c5bbc
Repository: https://github.com/allexsen/learning-project.git
Documentation: pkg.go.dev

# Functions

Atoi acts just as strconv.Atoi, except it also provides a centrilized error handling.
GenerateJWT sets expiration date to 24 hours, generates a new JWT, signs and returns the token string.
GetPasswordHashByEmail retrieves the password hash by email.
GetUserIDByUsername retrieves the user ID by username.
IsExistingCreds checks if the email and/or username are present in the db.
IsExistingEmail checks if the email is present in the db.
IsExistingEmail checks if the username is present in the db.
IsValidEmail is a regex for email validation.
IsValidName is a regex for name validation It returns an error if the name is invalid, nil otherwise.
ShouldBindJSON acts just as c.ShouldBindJSON, except it also provides a centralized error handling.
ValidateJWT checks the given token string by its expiration date, signature, and validity.

# Structs

Claims represents the JWT claims.