handle

package
v0.0.0-...-894ab8b Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2014 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package handle contains frontend handler functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redirect

type Redirect struct {
	UrlStr string
	Code   int
}

func (*Redirect) Error

func (r *Redirect) Error() string

Error is a hack: redirect is an error, thanks to this method

type Session

type Session struct {
	// contains filtered or unexported fields
}

func NewSession

func NewSession(r *http.Request, w http.ResponseWriter) *Session

func (*Session) ClearDefaults

func (s *Session) ClearDefaults()

ClearDefaults clears the default values for the current form. It is typically called when a post request was successful.

func (*Session) GetAccount

func (s *Session) GetAccount() *user.Account

func (*Session) GetDefaults

func (s *Session) GetDefaults() url.Values

GetDefaults returns the default values for the current form.

func (*Session) ReadFlashErrors

func (s *Session) ReadFlashErrors() frontend.ErrorMap

ReadFlashErrors reads the errors stored in the flash messages. Calling this method flushes the flash messages immediately.

func (*Session) RemoveAccount

func (s *Session) RemoveAccount()

func (*Session) Save

func (s *Session) Save() error

func (*Session) SaveDefault

func (s *Session) SaveDefault(key, value string)

SaveDefault is a shorthand for saving a single default key-value pair.

func (*Session) SaveDefaults

func (s *Session) SaveDefaults(values url.Values)

SaveDefaults saves the values as default for the current form.

func (*Session) SaveFlashError

func (s *Session) SaveFlashError(msg i18n.Key)

SaveFlashError is a shorthand for saving a single error message for the whole form (key "FORM").

func (*Session) SaveFlashErrors

func (s *Session) SaveFlashErrors(errMap frontend.ErrorMap)

SaveFlashErrors saves the error map into the session flash messages.

func (*Session) SetAccount

func (s *Session) SetAccount(a *user.Account)

type SignInArgs

type SignInArgs struct {
	User     string
	Password string
}

func (*SignInArgs) CleanUp

func (a *SignInArgs) CleanUp()

type SignUpArgs

type SignUpArgs struct {
	User            string
	Email           string
	Password        string
	PasswordConfirm string
}

func (*SignUpArgs) CleanUp

func (a *SignUpArgs) CleanUp()

type Worker

type Worker struct {
	*backend.Engine
	Server frontend.Server
	// contains filtered or unexported fields
}

func NewWorker

func NewWorker(engine *backend.Engine, server frontend.Server) *Worker

func (*Worker) EditText

func (w *Worker) EditText(context *frontend.Context) ([]byte, error)

func (*Worker) EditTextPOST

func (w *Worker) EditTextPOST(context *frontend.Context, session *Session) ([]byte, error)

func (*Worker) Extract

func (w *Worker) Extract(context *frontend.Context) ([]byte, error)

func (*Worker) Flavor

func (w *Worker) Flavor(context *frontend.Context) ([]byte, error)

func (*Worker) ForgotPassword

func (w *Worker) ForgotPassword(context *frontend.Context, session *Session) ([]byte, error)

func (*Worker) GetResetPassword

func (w *Worker) GetResetPassword(context *frontend.Context, session *Session) ([]byte, error)

func (*Worker) NewExtract

func (w *Worker) NewExtract(context *frontend.Context, session *Session) ([]byte, error)

func (*Worker) NewFlavor

func (w *Worker) NewFlavor(context *frontend.Context) ([]byte, error)

func (*Worker) NewFlavorPOST

func (w *Worker) NewFlavorPOST(context *frontend.Context, session *Session) ([]byte, error)

func (*Worker) ResetPassword

func (w *Worker) ResetPassword(context *frontend.Context, session *Session) ([]byte, error)

func (*Worker) SignIn

func (w *Worker) SignIn(context *frontend.Context, session *Session) ([]byte, error)

func (*Worker) SignOut

func (w *Worker) SignOut(context *frontend.Context, session *Session) ([]byte, error)

func (*Worker) SignUp

func (w *Worker) SignUp(context *frontend.Context, session *Session) ([]byte, error)

Jump to

Keyboard shortcuts

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