share-funcs

command
v12.2.8 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

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).

Jump to

Keyboard shortcuts

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