Documentation
¶
Index ¶
- Constants
- func EmailValidation(email string, err map[string][]string) (bool, map[string][]string)
- func IsAgreed(termsAndConditions string) bool
- func NewErrors() map[string][]string
- func NewInfos() map[string][]string
- func ValidateUsername(username string, err map[string][]string) (bool, map[string][]string)
- type LoginForm
- type PasswordForm
- type PasswordResetForm
- type RegistrationForm
- type SendPasswordResetForm
- type UserForm
Constants ¶
View Source
const EMAIL_REGEX = `(\w[-._\w]*\w@\w[-._\w]*\w\.\w{2,3})`
View Source
const USERNAME_REGEX = `(\W)`
Variables ¶
This section is empty.
Functions ¶
func EmailValidation ¶
Types ¶
type LoginForm ¶
type LoginForm struct { Username string `form:"username" needed:"true"` Password string `form:"password" needed:"true"` }
LoginForm is used when a user logs in.
type PasswordForm ¶
type PasswordForm struct { CurrentPassword string `form:"currentPassword"` Password string `form:"newPassword"` }
PasswordForm is used when updating a user password.
type PasswordResetForm ¶
type PasswordResetForm struct { PasswordResetToken string `form:"token"` Password string `form:"newPassword"` }
PasswordResetForm is used when reseting a password.
type RegistrationForm ¶
type RegistrationForm struct { Username string `form:"username" needed:"true" len_min:"3" len_max:"20"` Email string `form:"email"` Password string `form:"password" needed:"true" len_min:"6" len_max:"25" equalInput:"ConfirmPassword"` ConfirmPassword string `form:"password_confirmation" omit:"true" needed:"true"` CaptchaID string `form:"captchaID" omit:"true" needed:"true"` TermsAndConditions bool `form:"t_and_c" omit:"true" needed:"true" equal:"true" hum_name:"Terms and Conditions"` }
RegistrationForm is used when creating a user.
type SendPasswordResetForm ¶
type SendPasswordResetForm struct {
Email string `form:"email"`
}
SendPasswordResetForm is used when sending a password reset token.
type UserForm ¶
type UserForm struct { Username string `form:"username" needed:"true" len_min:"3" len_max:"20"` Email string `form:"email"` Language string `form:"language" default:"en-us"` CurrentPassword string `form:"current_password" len_min:"6" len_max:"25" omit:"true"` Password string `form:"password" len_min:"6" len_max:"25" equalInput:"Confirm_Password"` Confirm_Password string `form:"password_confirmation" omit:"true"` Status int `form:"status" default:"0"` }
UserForm is used when updating a user.
Click to show internal directories.
Click to hide internal directories.