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

Unified Diff: appengine/cmd/dm/distributor/tq_handler.go

Issue 2043423004: Make HTTP middleware easier to use (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Convert remaining source files 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/dm/distributor/tq_handler.go
diff --git a/appengine/cmd/dm/distributor/tq_handler.go b/appengine/cmd/dm/distributor/tq_handler.go
index 218f1eb23dbdb5e4a8cbbfcd787eddbcb2695247..631dcde1ced11211c265b6bafee208d8ba0e84df 100644
--- a/appengine/cmd/dm/distributor/tq_handler.go
+++ b/appengine/cmd/dm/distributor/tq_handler.go
@@ -9,10 +9,9 @@ import (
"net/url"
"strings"
- "github.com/julienschmidt/httprouter"
"github.com/luci/luci-go/appengine/tumble"
"github.com/luci/luci-go/common/logging"
- "golang.org/x/net/context"
+ "github.com/luci/luci-go/server/router"
)
const handlerPattern = "/tq/distributor/:cfgName"
@@ -24,9 +23,10 @@ func handlerPath(cfgName string) string {
// TaskQueueHandler is the http handler that routes taskqueue tasks made with
// Config.EnqueueTask to a distributor's HandleTaskQueueTask method.
//
-// This requires that c already have a Registry installed via the WithRegistry
-// method.
-func TaskQueueHandler(c context.Context, rw http.ResponseWriter, r *http.Request, p httprouter.Params) {
+// This requires that ctx.Context already have a Registry installed via the
+// WithRegistry method.
+func TaskQueueHandler(ctx *router.Context) {
+ c, rw, r, p := ctx.Context, ctx.Writer, ctx.Request, ctx.Params
defer r.Body.Close()
cfgName := p.ByName("cfgName")

Powered by Google App Engine
This is Rietveld 408576698