This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func chainMiddleware(middlewares []middleware, handler func(*http.ResponseWriter, *http.Request)) { | |
for _, middleware := range middlewares { | |
handler = middleware(handler) | |
} | |
return handler | |
} | |
handler := chainMIddleware([]Middleware{ | |
func(handler) { return BuidParamsHandler(handler, mux.Vars)} | |
func(handler) { return BuidProtectedHandler(handler, []string{enumRoles.roles})}, |