OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 package distributor | |
6 | |
7 import ( | |
8 "net/http" | |
9 | |
10 "github.com/julienschmidt/httprouter" | |
11 "github.com/luci/luci-go/appengine/gaemiddleware" | |
12 "github.com/luci/luci-go/server/middleware" | |
13 "golang.org/x/net/context" | |
14 ) | |
15 | |
16 // InstallHandlers installs the taskqueue callback handler. | |
17 // | |
18 // The `base` middleware must have a registry installed with WithRegistry. | |
19 func InstallHandlers(reg Registry, r *httprouter.Router, base middleware.Base) { | |
20 r.POST(handlerPattern, base( | |
21 gaemiddleware.RequireTaskQueue("", func(c context.Context, rw ht tp.ResponseWriter, r *http.Request, p httprouter.Params) { | |
22 TaskqueueHandler(WithRegistry(c, reg), rw, r, p) | |
dnj (Google)
2016/06/09 18:00:55
nit: Looks like we're using "TaskQueue" instead of
iannucci
2016/06/15 00:46:00
Done.
| |
23 }))) | |
24 | |
25 r.POST("/_ah/push-handlers/"+notifyTopicSuffix, base( | |
26 func(c context.Context, rw http.ResponseWriter, r *http.Request, p httprouter.Params) { | |
27 PubsubReciever(WithRegistry(c, reg), rw, r, p) | |
28 })) | |
29 } | |
OLD | NEW |