go-ozzo / ozzo-routing

An extremely fast Go (golang) HTTP router that supports regular expression route matching. Comes with full support for building RESTful APIs.
MIT License
455 stars 51 forks source link

Enable "reverse-engineering" a URI to determine the corresponding route and parameters #42

Closed jackwhelpton closed 6 years ago

jackwhelpton commented 7 years ago

I would like to be able to take a URI from the body of an HTTP request, something like:

/products/1234

and programmatically determine that this matches to a route:

/products/{id}

with "id" = 1234. This is obviously something the ozzo-routing framework is doing internally, and from a cursory inspection it looks like it could probably be accomplished by exposing the "store" object publicly.

Does this make sense? I'm happy to have a look at how it could be done in a separate fork... would a PR be considered if I can get it to work?