forms

package
v0.0.0-...-5e9aa0f Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(r *http.Request, f Form) (interface{}, error)

Types

type AfterSignupEvent

type AfterSignupEvent struct {
	User *oldmodels.User
}

type ChangePassword

type ChangePassword struct {
	Password    string `json:"password"`     // current password.
	NewPassword string `json:"new_password"` // new password.
	// contains filtered or unexported fields
}

ChangePassword changes password.

func NewChangePassword

func NewChangePassword(db *sqlex.DB, user *oldmodels.User) *ChangePassword

NewChangePassword returns a form to change password.

func (*ChangePassword) Handle

func (f *ChangePassword) Handle(ctx *clevergo.Context) error

Handle handles request.

func (*ChangePassword) Validate

func (f *ChangePassword) Validate() error

Validate validates form data.

type CheckUserEmail

type CheckUserEmail struct {
	Email string `json:"email"`
	// contains filtered or unexported fields
}

func NewCheckUserEmail

func NewCheckUserEmail(db *sqlex.DB) *CheckUserEmail

func (*CheckUserEmail) Validate

func (f *CheckUserEmail) Validate() error

type CheckUsername

type CheckUsername struct {
	Username string `json:"username"`
	// contains filtered or unexported fields
}

func NewCheckUsername

func NewCheckUsername(db *sqlex.DB) *CheckUsername

func (*CheckUsername) Validate

func (f *CheckUsername) Validate() error

type Contact

type Contact struct {
	Email     string `json:"email" xml:"email"`
	Subject   string `json:"subject" xml:"subject"`
	Content   string `json:"content" xml:"content"`
	Captcha   string `json:"captcha" xml:"captcha"`
	CaptchaID string `json:"captcha_id" xml:"captcha_id"`
	// contains filtered or unexported fields
}

func NewContact

func NewContact(mailer *mail.Dialer, captchaManager *captchas.Manager) *Contact

func (*Contact) Handle

func (c *Contact) Handle(ctx *clevergo.Context) (err error)

func (*Contact) Validate

func (c *Contact) Validate() error

type Error

type Error struct {
}

func (Error) Error

func (err Error) Error() string

type Form

type Form interface {
	Handle() (interface{}, error)
}

type Login

type Login struct {
	CaptchaID string `schema:"captcha_id" json:"captcha_id"`
	Captcha   string `schema:"captcha" json:"captcha"`
	Email     string `schema:"email" json:"email"`
	Password  string `schema:"password" json:"password"`
	// contains filtered or unexported fields
}

Login is a login form.

func NewLogin

func NewLogin(db *sqlex.DB, user *users.User, captchaManager *captchas.Manager) *Login

NewLogin returns a login form.

func (*Login) Handle

func (l *Login) Handle(ctx *clevergo.Context) (*oldmodels.User, error)

Handle handles login request.

func (*Login) Validate

func (l *Login) Validate() error

Validate validates form data.

type RequestResetPassword

type RequestResetPassword struct {
	Email     string `json:"email"`
	Captcha   string `json:"captcha"`
	CaptchaID string `json:"captcha_id"`
	// contains filtered or unexported fields
}

func NewRequestResetPassword

func NewRequestResetPassword(db *sqlex.DB, mailer *mail.Dialer, captchaManager *captchas.Manager) *RequestResetPassword

func (*RequestResetPassword) Handle

func (f *RequestResetPassword) Handle(ctx *clevergo.Context) (err error)

func (*RequestResetPassword) Validate

func (f *RequestResetPassword) Validate() error

type ResendVerificationEmail

type ResendVerificationEmail struct {
	Email     string `valid:"required,email" json:"email" xml:"email"`
	Captcha   string `valid:"required" json:"captcha" xml:"captcha"`
	CaptchaID string `valid:"required" json:"captcha_id" xml:"captcha_id"`
	// contains filtered or unexported fields
}

func NewResendVerificationEmail

func NewResendVerificationEmail(db *sqlex.DB, mailer *mail.Dialer, captchaManager *captchas.Manager) *ResendVerificationEmail

func (*ResendVerificationEmail) Handle

func (f *ResendVerificationEmail) Handle(ctx *clevergo.Context) (err error)

func (*ResendVerificationEmail) Validate

func (f *ResendVerificationEmail) Validate() error

type ResetPassword

type ResetPassword struct {
	Token    string `json:"token"`
	Password string `json:"password"`
	// contains filtered or unexported fields
}

func NewResetPassword

func NewResetPassword(db *sqlex.DB) *ResetPassword

func (*ResetPassword) Handle

func (f *ResetPassword) Handle(ctx *clevergo.Context) (err error)

func (*ResetPassword) Validate

func (f *ResetPassword) Validate() error

type Signup

type Signup struct {
	Email     string `json:"email" xml:"email"`
	Username  string `json:"username" xml:"username"`
	Password  string `json:"password" xml:"password"`
	Captcha   string `json:"captcha"`
	CaptchaID string `json:"captcha_id"`
	// contains filtered or unexported fields
}

func NewSignup

func NewSignup(db *sqlex.DB, user *users.User, captchaManager *captchas.Manager) *Signup

func (*Signup) Handle

func (su *Signup) Handle(ctx *clevergo.Context) (*oldmodels.User, error)

func (*Signup) RegisterOnAfterSignup

func (su *Signup) RegisterOnAfterSignup(f func(AfterSignupEvent))

func (*Signup) Validate

func (s *Signup) Validate() error

type VerifyEmail

type VerifyEmail struct {
	Token string `json:"token"`
	// contains filtered or unexported fields
}

func NewVerifyEmail

func NewVerifyEmail(db *sqlex.DB) *VerifyEmail

func (*VerifyEmail) Handle

func (f *VerifyEmail) Handle(ctx *clevergo.Context) (err error)

func (*VerifyEmail) Validate

func (f *VerifyEmail) Validate() error

Jump to

Keyboard shortcuts

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