I used gorilla route in my gateway project. So I route all http request to a same router, then I use some extra information to decided where the request should be transmit. Firstly I store information in router's name as router.Handle(Path, c.Handler).Name(Informations).Methods(Methods...)
and Informations := util.RouteConfFromStr(mux.CurrentRoute(r).GetName())
. But this looks a bit ugly. mux.Route
does't provide some properties to do this. Is there a better way to store extra information without extra struct in project such as map?