How to pass a parameter to middleware in Echo? There is an example of what I want to achieve.
func (h *handlers) Check(pm string, next echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
if pm == "test" {
return next(c)
}
return echo.NewHTTPError(http.StatusUnauthorized, "")
}
}
And I want to set the middleware like this:
route.Use(middleware.Check("test input"))