context

package
v0.0.0-...-17c3845 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contexter

func Contexter() macaron.Handler

func NotFound

func NotFound(ctx *Context)

func ReqAdmin

func ReqAdmin() macaron.Handler

Types

type Context

type Context struct {
	*macaron.Context
	Flash   *session.Flash
	Session session.Store

	User    *models.User
	Builder *models.Builder
	Task    *models.Task
}

func (*Context) Error

func (ctx *Context) Error(format string, a ...interface{})

func (*Context) Handle

func (ctx *Context) Handle(status int, title string, err error)

Handle handles and logs error by given status.

func (*Context) HasError

func (ctx *Context) HasError() bool

HasError returns true if error occurs in form validation.

func (*Context) NotFound

func (ctx *Context) NotFound()

func (*Context) RenderWithErr

func (ctx *Context) RenderWithErr(msg string, tpl string, userForm interface{})

RenderWithErr used for page has form validation but need to prompt error to users.

Jump to

Keyboard shortcuts

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