flight

package
v0.0.0-...-b76ee76 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package flight provides an abstraction around commonly used features.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Sess   *sessions.Session
	UserID string
	W      http.ResponseWriter
	R      *http.Request
}

Info holds the commonly used information.

func Context

func Context(w http.ResponseWriter, r *http.Request) *Info

Context returns commonly used information.

func (*Info) FlashError

func (c *Info) FlashError(err error)

FlashError saves an error flash and logs the error.

func (*Info) FlashNotice

func (c *Info) FlashNotice(message string)

FlashNotice saves a notice flash.

func (*Info) FlashSuccess

func (c *Info) FlashSuccess(message string)

FlashSuccess saves a success flash.

func (*Info) FlashWarning

func (c *Info) FlashWarning(message string)

FlashWarning saves a warning flash.

func (*Info) FormValid

func (c *Info) FormValid(fields ...string) bool

FormValid determines if the user submitted all the required fields and then saves an error flash. Returns true if form is valid.

func (*Info) Param

func (c *Info) Param(name string) string

Param gets the URL parameter.

func (*Info) Redirect

func (c *Info) Redirect(urlStr string)

Redirect sends a temporary redirect.

func (*Info) Repopulate

func (c *Info) Repopulate(v map[string]interface{}, fields ...string)

Repopulate fills the forms on the page after the user submits.

Jump to

Keyboard shortcuts

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