blue-jay / blueprint

Blueprint for your next web application in Go.
https://blue-jay.github.io/
MIT License
481 stars 77 forks source link

Test context instead of gorilla #5

Closed josephspurrier closed 7 years ago

josephspurrier commented 8 years ago

Since it will be in Go 1.7, it would be nice to eliminate dependencies and go back to the http/net package with the net/context package.

josephspurrier commented 8 years ago

Just checked Gorilla sessions, it still uses gorilla/context because it will require a breaking change: https://github.com/gorilla/sessions/issues/80. Will check back in a few weeks.

artemgrygor commented 7 years ago

@josephspurrier any updates here? Thanks

josephspurrier commented 7 years ago

@artemgrygor No, still waiting on Gorilla. Their issue is still open.

artemgrygor commented 7 years ago

No problem, Sir. So what do you suggest should we still use gorilla context or start integrate the http context to the app? Not sure that I want to have both in one app.

josephspurrier commented 7 years ago

I just had to research to figure out the difference between these packages. Gorilla context and gorilla sessions serve two different purposes. Context is only supposed to be used for the short lifetime of a single page request which is why you are supposed to clear using middleware at the end of the request. Sessions is for the lifetime of the cookie so basically multiple page requests. If you don't use gorilla sessions, you will need to use a different package or write your own that saves the session into a cookie or back-end storage.

artemgrygor commented 7 years ago

@josephspurrier thanks, now it's more clear. Using gorilla one then.