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

Unified Diff: server/settings/admin/index.go

Issue 2043423004: Make HTTP middleware easier to use (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Rebase origin/master 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: server/settings/admin/index.go
diff --git a/server/settings/admin/index.go b/server/settings/admin/index.go
index aa5d6d6501acd25d3c9a0c346427e5de98d7229c..c52cb3a0f080490a67936b375c83a72c2154f2a5 100644
--- a/server/settings/admin/index.go
+++ b/server/settings/admin/index.go
@@ -5,15 +5,13 @@
package admin
import (
- "net/http"
"sort"
"time"
"github.com/dustin/go-humanize"
- "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/settings"
"github.com/luci/luci-go/server/templates"
)
@@ -29,7 +27,9 @@ func (a pageIndexEntries) Len() int { return len(a) }
func (a pageIndexEntries) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a pageIndexEntries) Less(i, j int) bool { return a[i].Title < a[j].Title }
-func indexPage(c context.Context, rw http.ResponseWriter, r *http.Request, p httprouter.Params) {
+func indexPage(ctx *router.Context) {
+ c, rw := ctx.Context, ctx.Writer
+
entries := pageIndexEntries{}
for id, p := range settings.GetUIPages() {
title, err := p.Title(c)

Powered by Google App Engine
This is Rietveld 408576698