Giter VIP home page Giter VIP logo

Comments (4)

acmacalister avatar acmacalister commented on July 28, 2024

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.

ckstettler avatar ckstettler commented on July 28, 2024

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.

acmacalister avatar acmacalister commented on July 28, 2024

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.

ckstettler avatar ckstettler commented on July 28, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.