Documentation ¶
Index ¶
- func Handler(h HandlerFunc) echo.HandlerFunc
- func NewBaseContext() echo.MiddlewareFunc
- type BaseContext
- func (ctx *BaseContext) Auth() auth.Auth
- func (c *BaseContext) AutoFMT(code int, i interface{}) (err error)
- func (ctx *BaseContext) CookieDel(name string)
- func (ctx *BaseContext) CookieGet(name string) (string, error)
- func (ctx *BaseContext) CookieSet(name string, value string, others ...interface{})
- func (c *BaseContext) CustomJSON(code int, i interface{}, f string) (err error)
- func (ctx *BaseContext) OpenTracingSpan() opentracing.Span
- func (ctx *BaseContext) Session() session.Session
- type HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBaseContext ¶
func NewBaseContext() echo.MiddlewareFunc
Types ¶
type BaseContext ¶
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) 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
Click to show internal directories.
Click to hide internal directories.