 Chromium Code Reviews
 Chromium Code Reviews Issue 1537883002:
  Initial distributor implementation  (Closed) 
  Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
    
  
    Issue 1537883002:
  Initial distributor implementation  (Closed) 
  Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master| Index: appengine/cmd/dm/distributor/handlers.go | 
| diff --git a/appengine/cmd/dm/distributor/handlers.go b/appengine/cmd/dm/distributor/handlers.go | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..76788695b64e2befa87e98f0c84cb28224d65373 | 
| --- /dev/null | 
| +++ b/appengine/cmd/dm/distributor/handlers.go | 
| @@ -0,0 +1,29 @@ | 
| +// Copyright 2015 The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +package distributor | 
| + | 
| +import ( | 
| + "net/http" | 
| + | 
| + "github.com/julienschmidt/httprouter" | 
| + "github.com/luci/luci-go/appengine/gaemiddleware" | 
| + "github.com/luci/luci-go/server/middleware" | 
| + "golang.org/x/net/context" | 
| +) | 
| + | 
| +// InstallHandlers installs the taskqueue callback handler. | 
| +// | 
| +// The `base` middleware must have a registry installed with WithRegistry. | 
| +func InstallHandlers(reg Registry, r *httprouter.Router, base middleware.Base) { | 
| + r.POST(handlerPattern, base( | 
| + gaemiddleware.RequireTaskQueue("", func(c context.Context, rw http.ResponseWriter, r *http.Request, p httprouter.Params) { | 
| + 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.
 | 
| + }))) | 
| + | 
| + r.POST("/_ah/push-handlers/"+notifyTopicSuffix, base( | 
| + func(c context.Context, rw http.ResponseWriter, r *http.Request, p httprouter.Params) { | 
| + PubsubReciever(WithRegistry(c, reg), rw, r, p) | 
| + })) | 
| +} |