Comments (4)
I can see how that would be useful. I have been working on changing the Handle
type over to use the standard http handler, since Go 1.7 added contexts to the stdlib. That way we could more easily integrate with other packages as well as drop our custom handler altogether. That being said, do you think there is another way we could expose that info without having to have the customer handler?
from helm.
I am a newbie to Go though it reminds me of my C days and I love it!! I am not sure other inherent ways that may exist to provide such context in a Go way. One approach that would work is to provide a reverse lookup mechanism. If I can pass the URI received to a lookup function to get the matching route that would be sufficient to my needs.
from helm.
That is one of things that drew me to Go as well (that it was so similar to C). I think the reverse lookup would work, but might be cumbersome for the user of the API. What do you think if we just enabled a boolean on the router (much like the logging works today) to add the route if the user wants into the request of the context each time. That way it we can keep the default http handlers and still have a way to pull the pattern it was matched on?
from helm.
I had to do a little reading and search for context. Yes that seems like a much more convenient approach.
from helm.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helm.