echox

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2016 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

*

  • Copyright 2015 @ z3q.net.
  • name : echo
  • author : jarryliu
  • date : 2015-12-04 10:51
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : render
  • author : jarryliu
  • date : 2015-12-11 17:46
  • description :
  • history :

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGlobTemplateVars

func GetGlobTemplateVars() map[string]interface{}

获取全局模版变量

func GlobSet

func GlobSet(globVars map[string]interface{}, w RenderWatchFunc)

全局设定ECHO参数

func StopAttack

func StopAttack(h echo.HandlerFunc) echo.HandlerFunc

防SQL注入

Types

type Context

type Context struct {
	*echo.Context
	App     gof.App
	Session *session.Session
	// contains filtered or unexported fields
}

func ParseContext

func ParseContext(ctx *echo.Context, app gof.App) *Context

func (*Context) Debug

func (this *Context) Debug(err error) error

func (*Context) HttpRequest

func (this *Context) HttpRequest() *http.Request

func (*Context) HttpResponse

func (this *Context) HttpResponse() http.ResponseWriter

func (*Context) NewData

func (this *Context) NewData() *TemplateData

func (*Context) Render

func (this *Context) Render(code int, name string, data interface{}) error

覆写Render方法

func (*Context) RenderOK

func (this *Context) RenderOK(name string, data interface{}) error

func (*Context) StringOK

func (this *Context) StringOK(s string) error

type Echo

type Echo struct {
	*echo.Echo
	// contains filtered or unexported fields
}

func New

func New() *Echo

new echo instance

func (*Echo) Aanyx

func (this *Echo) Aanyx(path string, obj interface{})

注册动态获取处理程序 todo:?? 应复写Any

func (*Echo) Agetx

func (this *Echo) Agetx(path string, obj interface{})

func (*Echo) Anyx

func (this *Echo) Anyx(path string, h Handler)

注册自定义的GET/POST处理程序

func (*Echo) Apostx

func (this *Echo) Apostx(path string, obj interface{})

func (*Echo) Getx

func (this *Echo) Getx(path string, h Handler)

注册自定义的GET处理程序

func (*Echo) Postx

func (this *Echo) Postx(path string, h Handler)

注册自定义的GET/POST处理程序

func (*Echo) SetTemplateRender

func (this *Echo) SetTemplateRender(path string)

设置模板

type GoTemplateForEcho

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

func (*GoTemplateForEcho) Render

func (g *GoTemplateForEcho) Render(w io.Writer, name string, data interface{}) error

type Handler

type Handler func(*Context) error

type HandlerProvider

type HandlerProvider interface {
	FactoryHandler(path string) *Handler
}

type HttpHosts

type HttpHosts map[string]http.Handler

func (HttpHosts) ServeHTTP

func (this HttpHosts) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RenderWatchFunc

type RenderWatchFunc func(echo.Renderer)

type TemplateData

type TemplateData struct {
	Var  map[string]interface{}
	Map  map[string]interface{}
	Data interface{}
}

func NewRenderData

func NewRenderData() *TemplateData

Jump to

Keyboard shortcuts

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