Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different Context? (Appengine) #94

Closed
schmitch opened this issue Aug 15, 2014 · 1 comment
Closed

Different Context? (Appengine) #94

schmitch opened this issue Aug 15, 2014 · 1 comment

Comments

@schmitch
Copy link

Is it possible to have a different Context then gin.Context? I'am using appengine and i need to use some app engine related context

https://developers.google.com/appengine/docs/go/gettingstarted/usingusers

@manucorporat
Copy link
Contributor

hey, you can't. but you do not need to. Since the app engine context is a different matter.

As you can see in the sample code:

func handler(w http.ResponseWriter, r *http.Request) {
    appengineContext := appengine.NewContext(r)

the app engine context takes as argument the http.Request, right?

You can do exactly the same in Gin, since the Gin context includes the SAME http.Request.
Try this:

func handler(c *gin.Context) {
    appengineContext := appengine.NewContext(c.Request)

does it make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants