Re: [go-nuts] Golang Custom Application Context

2020-08-24 Thread Gregor Best
Templates aren't really request scopedĀ  though, right? I read the term "request scoped" as "things like request IDs, timing information and maybe user authentication". What I usually do in situations like this is to make the handler functions methods of a `RequestHandler` type which in your ca

[go-nuts] Golang Custom Application Context

2020-08-20 Thread Ibraheem Ahmed
In my application I store a map of all my templates (`map[string]*template.Template`) in an `ApplicationEngine` struct, which is my application framework instance. I am currently using the standard `context.Context` to pass request scoped values between my middlewares and handlers. I need a way