How do I pass along some extra variables to an Echo mux handler?
I have registered a route like this in main.go:
e.GET("/search/:query", handlers.Search(*kindex, app.infoLog))
As you might see this is not the correct signature for the handler. It should have been passed without any arguments. i.e handlers.Search
How can I access kindex and infoLog from my Search handler?
func Search(c echo.Context, kindex string, infoLog *log.Logger) error {
# Should I access a global variable from here?
infoLog.Printf("Kendra Index: %v\n", kindex)
# cut..
}