base

package
v0.0.0-...-b1f09d4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(h HandlerFunc) echo.HandlerFunc

*

  • 自定义Context的Handler

func NewBaseContext

func NewBaseContext() echo.MiddlewareFunc

Types

type BaseContext

type BaseContext struct {
	echo.Context
}

func (*BaseContext) Auth

func (ctx *BaseContext) Auth() auth.Auth

func (*BaseContext) AutoFMT

func (c *BaseContext) AutoFMT(code int, i interface{}) (err error)

*

  • 以接口参数或后缀返回数据
  • JSONP、JSON/XML

func (*BaseContext) CookieDel

func (ctx *BaseContext) CookieDel(name string)

func (*BaseContext) CookieGet

func (ctx *BaseContext) CookieGet(name string) (string, error)

func (*BaseContext) CookieSet

func (ctx *BaseContext) CookieSet(name string, value string, others ...interface{})

others are ordered as cookie's max age time, path,domain, secure and httponly.

func (*BaseContext) CustomJSON

func (c *BaseContext) CustomJSON(code int, i interface{}, f string) (err error)

自定义JSON解析

func (*BaseContext) OpenTracingSpan

func (ctx *BaseContext) OpenTracingSpan() opentracing.Span

func (*BaseContext) Session

func (ctx *BaseContext) Session() session.Session

type HandlerFunc

type HandlerFunc func(*BaseContext) error

Jump to

Keyboard shortcuts

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