context

package
v0.0.0-...-23e694f Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2016 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignForm

func AssignForm(form interface{}, data map[string]interface{})

AssignForm assign form values back to the template data.

func Contexter

func Contexter() macaron.Handler

func GetSize

func GetSize(field reflect.StructField) string

func I18n

func I18n(key string) string

func Validate

func Validate(errs binding.Errors, data map[string]interface{}, f Form, l macaron.Locale) binding.Errors

Types

type Context

type Context struct {
	*macaron.Context

	Session session.Store
	Flash   *session.Flash
	Cache   cache.Cache
	// contains filtered or unexported fields
}

func (*Context) HTML

func (ctx *Context) HTML(status int, name string)

func (*Context) HasError

func (ctx *Context) HasError() bool

func (*Context) RenderWithErr

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

type Form

type Form interface {
	binding.Validator
}

type Login

type Login struct {
	Username string `binding:"Required"`
	Password string `binding:"Required"`
}

func (*Login) Validate

func (f *Login) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors

Jump to

Keyboard shortcuts

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