Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: appengine/cmd/cron/ui/index.go

Issue 2043423004: Make HTTP middleware easier to use (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Update tests Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package ui 5 package ui
6 6
7 import ( 7 import (
8 "net/http"
9
10 "github.com/julienschmidt/httprouter"
11 "golang.org/x/net/context"
12
13 "github.com/luci/luci-go/common/clock" 8 "github.com/luci/luci-go/common/clock"
9 "github.com/luci/luci-go/server/router"
14 "github.com/luci/luci-go/server/templates" 10 "github.com/luci/luci-go/server/templates"
15 ) 11 )
16 12
17 func indexPage(c context.Context, w http.ResponseWriter, r *http.Request, p http router.Params) { 13 func indexPage(c *router.Context) {
18 » jobs, err := config(c).Engine.GetAllCronJobs(c) 14 » jobs, err := config(c.Context).Engine.GetAllCronJobs(c.Context)
iannucci 2016/06/13 19:23:28 wdyt about making router.Context embed context.Con
19 if err != nil { 15 if err != nil {
20 panic(err) 16 panic(err)
21 } 17 }
22 » templates.MustRender(c, w, "pages/index.html", map[string]interface{}{ 18 » templates.MustRender(c.Context, c.Writer, "pages/index.html", map[string ]interface{}{
23 » » "Jobs": convertToSortedCronJobs(jobs, clock.Now(c).UTC()), 19 » » "Jobs": convertToSortedCronJobs(jobs, clock.Now(c.Context).UTC() ),
24 }) 20 })
25 } 21 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698