Add context
This commit adds and passes context around to (almost) every function. This allows cancelling (almost) every function call globally.
This commit is contained in:
parent
996ecb9f80
commit
3455f491ca
104 changed files with 836 additions and 511 deletions
|
|
@ -26,10 +26,10 @@ type Home struct {
|
|||
|
||||
func (*Home) Routes() []string { return []string{"/"} }
|
||||
|
||||
func (home *Home) Handler(route string, context context.Context, io stream.IOStream) (http.Handler, error) {
|
||||
home.updateRedirect(context, io)
|
||||
home.updateInstances(context, io)
|
||||
home.updateRender(context, io)
|
||||
func (home *Home) Handler(ctx context.Context, route string, io stream.IOStream) (http.Handler, error) {
|
||||
home.updateRedirect(ctx, io)
|
||||
home.updateInstances(ctx, io)
|
||||
home.updateRender(ctx, io)
|
||||
return home, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue