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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: appengine/cmd/cron/ui/index.go
diff --git a/appengine/cmd/cron/ui/index.go b/appengine/cmd/cron/ui/index.go
index da80ad745253df7f24037d73bb05dea153663316..c22ba660b2af0e50c5187a1f45b9261c9651aafb 100644
--- a/appengine/cmd/cron/ui/index.go
+++ b/appengine/cmd/cron/ui/index.go
@@ -5,21 +5,17 @@
package ui
import (
- "net/http"
-
- "github.com/julienschmidt/httprouter"
- "golang.org/x/net/context"
-
"github.com/luci/luci-go/common/clock"
+ "github.com/luci/luci-go/server/router"
"github.com/luci/luci-go/server/templates"
)
-func indexPage(c context.Context, w http.ResponseWriter, r *http.Request, p httprouter.Params) {
- jobs, err := config(c).Engine.GetAllCronJobs(c)
+func indexPage(c *router.Context) {
+ jobs, err := config(c.Context).Engine.GetAllCronJobs(c.Context)
iannucci 2016/06/13 19:23:28 wdyt about making router.Context embed context.Con
if err != nil {
panic(err)
}
- templates.MustRender(c, w, "pages/index.html", map[string]interface{}{
- "Jobs": convertToSortedCronJobs(jobs, clock.Now(c).UTC()),
+ templates.MustRender(c.Context, c.Writer, "pages/index.html", map[string]interface{}{
+ "Jobs": convertToSortedCronJobs(jobs, clock.Now(c.Context).UTC()),
})
}

Powered by Google App Engine
This is Rietveld 408576698