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

Unified Diff: appengine/cmd/dm/distributor/pubsub.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/pubsub.go
diff --git a/appengine/cmd/dm/distributor/pubsub.go b/appengine/cmd/dm/distributor/pubsub.go
index 65df41215b52bf74bfeee8f524483f01ce183ed7..a4cf5b4eea720029142d62e81ad0a920a6f2e4c9 100644
--- a/appengine/cmd/dm/distributor/pubsub.go
+++ b/appengine/cmd/dm/distributor/pubsub.go
@@ -11,23 +11,24 @@ import (
"strconv"
"time"
- "github.com/julienschmidt/httprouter"
"github.com/luci/luci-go/appengine/tumble"
"github.com/luci/luci-go/common/api/dm/service/v1"
"github.com/luci/luci-go/common/logging"
+ "github.com/luci/luci-go/server/router"
"github.com/luci/luci-go/server/tokens"
"golang.org/x/net/context"
)
const notifyTopicSuffix = "dm-distributor-notify"
-// PubsubReciever is the HTTP handler that processes incoming pubsub events
+// PubsubReceiver is the HTTP handler that processes incoming pubsub events
// delivered to topics prepared with TaskDescription.PrepareTopic, and routes
// them to the appropriate distributor implementation's HandleNotification
// method.
//
// It requires that a Registry be installed in c via WithRegistry.
-func PubsubReciever(c context.Context, rw http.ResponseWriter, r *http.Request, p httprouter.Params) {
+func PubsubReceiver(ctx *router.Context) {
+ c, rw, r := ctx.Context, ctx.Writer, ctx.Request
defer r.Body.Close()
type PubsubMessage struct {

Powered by Google App Engine
This is Rietveld 408576698