forms

package
v0.0.0-...-0f478d8 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2014 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeForm

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

Types

type Form

type Form interface {
	Validate() error
}

type LoginForm

type LoginForm struct {
	// 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) Validate

func (f *LoginForm) Validate() error

type SignupForm

type SignupForm struct {
	Email                string `schema:"email"`
	EmailConfirmation    string `schema:"email-confirmation"`
	Password             string `schema:"password"`
	PasswordConfirmation string `schema:"password-confirmation"`
}

func (SignupForm) User

func (f SignupForm) User() (*entities.User, 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