Documentation ¶
Index ¶
- Constants
- Variables
- func GeneratePassword(n int) (string, error)
- func GenerateSalt(n int) (string, error)
- func GenerateSlug(n int) (string, error)
- func GenerateUserCredentials(password string) (string, []byte, error)
- func HashToken(token string) []byte
- func RespondWithError(c *fiber.Ctx, statusCode int, detail string, fieldErrors map[string][]string, ...) error
- type ErrorResponseBody
- type VaultsErrorResponseBody
Constants ¶
View Source
const ( CreateAccount string = "create_account" LogInAccount string = "log_in_account" )
View Source
const ( ErrorBadRequest string = "Bad request." ErrorServer string = "Oops, something went wrong!" ErrorDiffEmail string = "Oops, that didn't work - try again with a different email address." ErrorFailedLogin string = "Oops, failed to log in - try again!" )
View Source
const ( ErrorParse string = "Failed to parse request body." ErrorAcctName string = "Invalid `name`." ErrorAcctEmail string = "Invalid `email`." ErrorAcctPW string = "Invalid `password`." ErrorNonMatchPW string = "Non-matching password inputs." ErrorCreateUser string = "Failed create user transaction." ErrorFailedDB string = "Failed DB operation." ErrorNoRowsAffected string = "result.RowsAffected == 0" )
View Source
const DIGITS string = "0123456789"
View Source
const LOWERCASE_LETTERS string = "abcdefghijklmnopqrstuvwxyz"
View Source
const PASSWORD_ALPHABET = UPPERCASE_LETTERS + LOWERCASE_LETTERS + DIGITS + SPECIAL_CHARS
View Source
const SLUG_ALPHABET = UPPERCASE_LETTERS + LOWERCASE_LETTERS + DIGITS + "_-"
View Source
const SPECIAL_CHARS string = "`~!@#$%^&*()-=_+,./<>?;':\"[]\\{}|"
View Source
const UPPERCASE_LETTERS string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Variables ¶
View Source
var ( SlugRegexp = regexp.MustCompile(`^[\w-]{32}$`) TokenRegexp = regexp.MustCompile(`^[\w-]{144}$`) RowsRegexp = regexp.MustCompile(`^result.RowsAffected \([0-9]+\) > 1$`) )
Functions ¶
func GeneratePassword ¶
func GenerateSalt ¶
func GenerateSlug ¶
func GenerateUserCredentials ¶
Types ¶
type ErrorResponseBody ¶
Click to show internal directories.
Click to hide internal directories.