Closed oleksandr closed 11 years ago
It seems that is already possible with c.Data().Set/Get, right?
Right, the context.Data
thing is exactly for that. Goweb ignores the Data
object.
It's an objects.Map
from the http://godoc.org/github.com/stretchr/stew/objects package.
This could be a good example: http://www.gorillatoolkit.org/pkg/context
Thus in the request handling chain (Before -> Controller's Method -> After) it would be really easy to share the data.
As an example we use:
This would help to avoid duplication of code especially related to authentication...