Context概念
Context是iris框架中的一个路由上下文对象,在iris框架中的源码路径定义为:{$goPath}\http://github.com\kataras\iris\context\context.go。以下是Context的声明和定义:
package context
type Context interface {
BeginRequest(http.ResponseWriter, *http.Request)
EndRequest()
ResponseWriter() ResponseWriter
ResetResponseWriter(ResponseWriter)
Request() *http.Request
SetCurrentRouteName(currentRouteName string)
GetCurrentRoute() RouteReadOnly
Do(Handlers)
AddHandler(...Handler)
SetHandlers(Handlers)
Handlers() Handlers
HandlerIndex(n int) (currentIndex int)
Proceed(Handler) bool
HandlerName() string
Next()
NextOr(handlers ...Handler) bool
NextOrNotFound() bool
NextHandler() Handler
Skip()
StopExecution()
IsStopped() bool
Params() *RequestParams
Values() *memstore.Store
Translate(format string, args ...i