| Index: appengine/logdog/coordinator/service.go
|
| diff --git a/appengine/logdog/coordinator/service.go b/appengine/logdog/coordinator/service.go
|
| index 0358de953dfc68e968bb55bf29ca166a4308ae42..5d6711c0e1c5e0c71ee17ee8b47a47a91abc3c20 100644
|
| --- a/appengine/logdog/coordinator/service.go
|
| +++ b/appengine/logdog/coordinator/service.go
|
| @@ -1,33 +1,31 @@
|
| // Copyright 2015 The LUCI Authors. All rights reserved.
|
| // Use of this source code is governed under the Apache License, Version 2.0
|
| // that can be found in the LICENSE file.
|
|
|
| package coordinator
|
|
|
| import (
|
| - "net/http"
|
| "sync"
|
| "sync/atomic"
|
|
|
| - "github.com/julienschmidt/httprouter"
|
| gaeauthClient "github.com/luci/luci-go/appengine/gaeauth/client"
|
| "github.com/luci/luci-go/appengine/logdog/coordinator/config"
|
| luciConfig "github.com/luci/luci-go/common/config"
|
| "github.com/luci/luci-go/common/errors"
|
| "github.com/luci/luci-go/common/gcloud/gs"
|
| "github.com/luci/luci-go/common/gcloud/pubsub"
|
| log "github.com/luci/luci-go/common/logging"
|
| "github.com/luci/luci-go/common/proto/logdog/svcconfig"
|
| "github.com/luci/luci-go/server/logdog/storage"
|
| "github.com/luci/luci-go/server/logdog/storage/bigtable"
|
| - "github.com/luci/luci-go/server/middleware"
|
| + "github.com/luci/luci-go/server/router"
|
| "golang.org/x/net/context"
|
| "google.golang.org/cloud"
|
| gcps "google.golang.org/cloud/pubsub"
|
| "google.golang.org/grpc/metadata"
|
| )
|
|
|
| // Services is a set of support services used by Coordinator.
|
| //
|
| // Each Services instance is valid for a singel request, but can be re-used
|
| // throughout that request. This is advised, as the Services instance may
|
| @@ -56,27 +54,25 @@ type Services interface {
|
| // The caller must close the returned instance if successful.
|
| IntermediateStorage(context.Context) (storage.Storage, error)
|
|
|
| // GSClient instantiates a Google Storage client.
|
| GSClient(context.Context) (gs.Client, error)
|
|
|
| // ArchivalPublisher returns an ArchivalPublisher instance.
|
| ArchivalPublisher(context.Context) (ArchivalPublisher, error)
|
| }
|
|
|
| -// WithProdServices is a middleware Handler that installs a production Services
|
| +// WithProdServices is a middleware that installs a production Services
|
| // instance into its Context.
|
| -func WithProdServices(h middleware.Handler) middleware.Handler {
|
| - return func(c context.Context, rw http.ResponseWriter, r *http.Request, params httprouter.Params) {
|
| - c = UseProdServices(c)
|
| - h(c, rw, r, params)
|
| - }
|
| +func WithProdServices(c *router.Context, next router.Handler) {
|
| + c.Context = UseProdServices(c.Context)
|
| + next(c)
|
| }
|
|
|
| // UseProdServices installs production Services instance into the supplied
|
| // Context.
|
| func UseProdServices(c context.Context) context.Context {
|
| return WithServices(c, &prodServicesInst{})
|
| }
|
|
|
| // prodServicesInst is a Service exposing production faciliites. A unique
|
| // instance is bound to each each request.
|
|
|