form

package
v0.0.0-...-5607d3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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

func EmailValidation(email string, err map[string][]string) (bool, map[string][]string)

func IsAgreed

func IsAgreed(termsAndConditions string) bool

func NewErrors

func NewErrors() map[string][]string

func NewInfos

func NewInfos() map[string][]string

func ValidateUsername

func ValidateUsername(username string, err map[string][]string) (bool, map[string][]string)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL