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

Unified Diff: appengine/cmd/milo/buildbot/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/milo/buildbot/pubsub.go
diff --git a/appengine/cmd/milo/buildbot/pubsub.go b/appengine/cmd/milo/buildbot/pubsub.go
index 0f883fa30c9d74c8f5a1d4c121a453adffdc3628..d4d88df1de90584a66e698b1d21beef076b26bdf 100644
--- a/appengine/cmd/milo/buildbot/pubsub.go
+++ b/appengine/cmd/milo/buildbot/pubsub.go
@@ -10,15 +10,14 @@ import (
"compress/zlib"
"encoding/base64"
"encoding/json"
- "net/http"
"time"
"github.com/luci/gae/service/datastore"
"github.com/luci/luci-go/common/clock"
"github.com/luci/luci-go/common/iotools"
log "github.com/luci/luci-go/common/logging"
+ "github.com/luci/luci-go/server/router"
- "github.com/julienschmidt/httprouter"
"golang.org/x/net/context"
)
@@ -118,8 +117,9 @@ func unmarshal(
}
// PubSubHandler is a webhook that stores the builds coming in from pubsub.
-func PubSubHandler(
- c context.Context, h http.ResponseWriter, r *http.Request, p httprouter.Params) {
+func PubSubHandler(ctx *router.Context) {
+ c, h, r := ctx.Context, ctx.Writer, ctx.Request
+
msg := pubSubSubscription{}
defer r.Body.Close()
dec := json.NewDecoder(r.Body)

Powered by Google App Engine
This is Rietveld 408576698