forms

package
v0.0.0-...-7f62c2e Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2013 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoginFailedError = errors.New("Login failed")

Functions

func DecodeForm

func DecodeForm(form interface{}, req *http.Request) error

Types

type Form

type Form interface {
	Validate() error
	Save() error
}

type LoginForm

type LoginForm struct {
	ResponseWriter http.ResponseWriter         `schema:"-"`
	Request        *http.Request               `schema:"-"`
	Users          repositories.UserRepository `schema:"-"`
	User           *entities.User              `schema:"-"`
	// Need to include this because of gorilla/schema.
	// Schema should really ignore this field if it is
	// not declared in the struct or set to "-".
	// However, it currently returns an error on decode
	CsrfToken string `schema:"CsrfToken"`
	Email     string `schema:"email"`
	Password  string `schema:"password"`
}

func (*LoginForm) Save

func (f *LoginForm) Save() error

func (*LoginForm) Validate

func (f *LoginForm) Validate() error

type SignupForm

type SignupForm struct {
	Users                repositories.UserRepository `schema:"_"`
	Email                string                      `schema:"email"`
	EmailConfirmation    string                      `schema:"email-confirmation"`
	Password             string                      `schema:"password"`
	PasswordConfirmation string                      `schema:"password-confirmation"`
}

func (*SignupForm) Save

func (f *SignupForm) Save() error

func (*SignupForm) Validate

func (f *SignupForm) Validate() error

Jump to

Keyboard shortcuts

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