Documentation
¶
Index ¶
Constants ¶
View Source
const ( VAR_PREFIX = "<<" VAR_SUFFIX = ">>" NameInt = "int" NameString = "string" NameSlug = "slug" NameUUID = "uuid" NameAny = "any" NameHex = "hex" NameEmail = "email" NamePhone = "phone" NameBool = "bool" NameFloat = "float" )
View Source
const ( // Match any character REGEX_ANY = ".+" // Match any number REGEX_NUM = "[0-9]+" // Match any string REGEX_STR = "[a-zA-Z]+" // Match any hex number REGEX_HEX = "[0-9a-fA-F]+" // Match any UUID REGEX_UUID = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" // Match any alphanumeric string REGEX_ALPHANUMERIC = "[0-9a-zA-Z_-]+" // Match any email address REGEX_EMAIL = `(?:[a-z0-9!#$%&'*+/=?^_` + "`" + `{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_` + "`" + `{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])` // Match any phone number REGEX_PHONE = `^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$` // Match any boolean REGEX_BOOL = "true|false|True|False|TRUE|FALSE|1|0" // Match any float REGEX_FLOAT = `\d+\.\d+|\d+,\d+` )
Variables ¶
This section is empty.
Functions ¶
func PasswordStrength ¶
Checks if: - password is at least 8 characters long - password is at most 64 characters long - password contains at least one uppercase letter - password contains at least one lowercase letter - password contains at least one digit - password contains at least one non-digit - password does not contain any whitespace
Types ¶
type FormValue ¶ added in v1.0.6
type FormValue interface {
IsFile() bool
Value() string
File() (string, io.ReadCloser)
}
Click to show internal directories.
Click to hide internal directories.