Closed jackwhelpton closed 6 years ago
Instead of directly exposing find
, I think we should wrap it with a new public method to have a more meaningful function signature, something like this
Find(method, path string) (handlers []Handler, params map[string]string)
That makes a lot of sense; I've done that in the latest commit. Let me know if there are any other changes you'd like to see.
As a follow-up question, I'm actually working with the fasthttp-routing adaptation of ozzo-routing, so I'd like to get this change over to there too. I could make a separate PR to re-implement this small change, but I wonder if it might make more sense to make a fresh fork of ozzo-routing and re-introduce the fasthttp changes there, as the current fasthttp-routing looks to be several years behind what's here?
I can fork ozzo again into my personal Github and just make those changes there (i.e. github.com/jackwhelpton/fasthttp-routing), but would you have a preferred method for updating the current version?
Thanks!
Regarding fasthttp-routing, yes it's outdated (far behind from both ozzo-routing and fasthttp). So it makes sense to fork from the latest ozzo-routing and incorporates the latest fasthttp. I think it makes sense to keep it under your personal github.
I raised a ticket to discuss this proposal about a month ago:
https://github.com/go-ozzo/ozzo-routing/issues/42
The change is very slight, just exposing the Find method on the router. The purpose of this is to allow an API to map an internal or "self" link to a database entity, by determining the ID of the object that link represents.
I've also moved the Find method up in its file to keep all the public methods together.