Chromium Code Reviews| Index: logdog/appengine/coordinator/backend/routes.go |
| diff --git a/logdog/appengine/cmd/coordinator/backend/main.go b/logdog/appengine/coordinator/backend/routes.go |
| similarity index 50% |
| copy from logdog/appengine/cmd/coordinator/backend/main.go |
| copy to logdog/appengine/coordinator/backend/routes.go |
| index cdf25354e67b2f1360336d6dc06d3b11e858c9ca..679ea3b2df4028b0f1792a9bcb802a55d8ecda41 100644 |
| --- a/logdog/appengine/cmd/coordinator/backend/main.go |
| +++ b/logdog/appengine/coordinator/backend/routes.go |
| @@ -1,4 +1,4 @@ |
| -// Copyright 2015 The LUCI Authors. |
| +// Copyright 2017 The LUCI Authors. |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| @@ -12,31 +12,21 @@ |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| -package module |
| +package backend |
|
dnj
2017/08/03 03:45:55
This is actually a new file. I guess it thinks it'
|
| import ( |
| - "net/http" |
| - |
| - // Importing pprof implicitly installs "/debug/*" profiling handlers. |
| - _ "net/http/pprof" |
| - |
| "github.com/luci/luci-go/appengine/gaemiddleware" |
| - "github.com/luci/luci-go/logdog/appengine/coordinator" |
| "github.com/luci/luci-go/server/router" |
| - "github.com/luci/luci-go/tumble" |
| - |
| - // Include mutations package so its Mutations will register with tumble via |
| - // init(). |
| - _ "github.com/luci/luci-go/logdog/appengine/coordinator/mutations" |
| ) |
| -func init() { |
| - tmb := tumble.Service{} |
| - |
| - r := router.New() |
| - base := gaemiddleware.BaseProd().Extend(coordinator.ProdCoordinatorService) |
| - tmb.InstallHandlers(r, base) |
| - gaemiddleware.InstallHandlersWithMiddleware(r, base) |
| +const ( |
| + // ArchivalTaskQueue is the name of the archival task queue. |
| + ArchivalTaskQueue = "archival" |
| +) |
| - http.Handle("/", r) |
| +// InstallHandlers installs backend handlers into the supplied Router. |
| +func InstallHandlers(r *router.Router, base router.MiddlewareChain) { |
| + r.POST("/internal/tasks/archival", |
| + base.Extend(gaemiddleware.RequireTaskQueue(ArchivalTaskQueue)), |
| + handleArchivalTask) |
| } |