Documentation
¶
Index ¶
- Variables
- func CheckPassword(plain string, hashed string) bool
- func GeneratePassword() string
- func GetRandomPfp(seed, path string) (string, error)
- func HashAndSalt(password string) (string, error)
- func LoadEnv()
- func RandomInt(max int) int
- func SendEmail(to []string, topic, message string) error
- func ValidateEmail(email string) bool
- func ValidateName(username string) bool
- func ValidatePassword(password string) bool
Constants ¶
This section is empty.
Variables ¶
var GlobalEnv = models.Environment{}
keep env vars in runtime
Functions ¶
func CheckPassword ¶
check if plain string password is the equivalent of a given hash
func GeneratePassword ¶
func GeneratePassword() string
generates a random password of 12 characters long with random uppercase and lowercase letters and random numbers
func GetRandomPfp ¶
make http request and get a random SVG profile picture from given randomness seed, returns empty string if an error occurs. The name is auto-generated by the function, on the path must go only the name of the user directory,
func HashAndSalt ¶
hash and salt plain string password, returns the hashed password
func SendEmail ¶
handles internally all the required logic to send an email by given values, it can send html mails
func ValidateEmail ¶
validate through REGEX if a string is a valid email address
func ValidateName ¶
check if the given string is valid to be used as username or reponame for the application (git actions, url, etc). A valid username can only: have letters, numbers and the characters - or _, have a minimum of 3 characters and maximum 25
func ValidatePassword ¶
checks if a string has at least 8 characters at least 1 number and at least one uppercase
Types ¶
This section is empty.