Chromium Code Reviews| Index: appengine/logdog/coordinator/coordinatorTest/service.go |
| diff --git a/appengine/logdog/coordinator/coordinatorTest/service.go b/appengine/logdog/coordinator/coordinatorTest/service.go |
| index 6b37dffbf9373d0d49f8b6bb9ee910ec3279c1d7..1bf28b580f197850ee47a3145f568cfc51cc3bf6 100644 |
| --- a/appengine/logdog/coordinator/coordinatorTest/service.go |
| +++ b/appengine/logdog/coordinator/coordinatorTest/service.go |
| @@ -7,7 +7,9 @@ package coordinatorTest |
| import ( |
| "github.com/luci/luci-go/appengine/logdog/coordinator" |
| "github.com/luci/luci-go/appengine/logdog/coordinator/config" |
| + luciConfig "github.com/luci/luci-go/common/config" |
| "github.com/luci/luci-go/common/gcloud/gs" |
| + "github.com/luci/luci-go/common/proto/logdog/svcconfig" |
| "github.com/luci/luci-go/server/logdog/storage" |
| "golang.org/x/net/context" |
| ) |
| @@ -19,6 +21,10 @@ type Services struct { |
| // local static members. |
| C func() (*config.Config, error) |
| + // PC, if nto nil, will be used to get the return values for ProjectConfig, |
|
nodir
2016/05/18 16:05:35
typo in not
dnj (Google)
2016/05/18 16:46:06
Done.
|
| + // overriding local static members. |
| + PC func() (*svcconfig.ProjectConfig, error) |
| + |
| // Storage returns an intermediate storage instance for use by this service. |
| // |
| // The caller must close the returned instance if successful. |
| @@ -38,13 +44,15 @@ func (s *Services) Config(c context.Context) (*config.Config, error) { |
| if s.C != nil { |
| return s.C() |
| } |
| + return config.Load(c) |
| +} |
| - gcfg, err := config.Load(c) |
| - if err != nil { |
| - return nil, err |
| +// ProjectConfig implements coordinator.Services. |
| +func (s *Services) ProjectConfig(c context.Context, project luciConfig.ProjectName) (*svcconfig.ProjectConfig, error) { |
| + if s.PC != nil { |
| + return s.PC() |
| } |
| - |
| - return gcfg, nil |
| + return config.ProjectConfig(c, project) |
| } |
| // IntermediateStorage implements coordinator.Services. |