Documentation ¶
Overview ¶
Package main shows how you can share a function between handlers of the same chain. Note that, this case is very rarely used and it exists, mostly, for 3rd-party middleware creators.
The middleware creator registers a dynamic function by Context.SetFunc and the route handler just needs to call Context.CallFunc(funcName, arguments), without knowning what is the specific middleware's implementation or who was the creator of that function, it may be a basicauth middleware's logout or session's logout.
See Context.SetLogoutFunc and Context.Logout methods too (these are not covered here).
Click to show internal directories.
Click to hide internal directories.