You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.
Action is an interface in an middleware and context.Context is also an interface. Their are some similar feature between Action and context.Context. In tango, we use assert to get the info from Action, in context.Context, it's also a regular usage get info via assert.
func (ctx*tango.Ctx) {
ifsess, ok:=ctx.Action().(Sessioner); ok {
// do something
}
}
func (resp http.ResponseWriter, req*http.Request) {
ifsess, ok:=req.Context().(Sessioner); ok {
// do something
}
}
So that maybe all the tango's middlewares could be changed slightly to apply in http.Handler.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Action is an interface in an middleware and
context.Context
is also an interface. Their are some similar feature between Action andcontext.Context
. In tango, we use assert to get the info from Action, incontext.Context
, it's also a regular usage get info via assert.So that maybe all the tango's middlewares could be changed slightly to apply in
http.Handler
.The text was updated successfully, but these errors were encountered: