Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3989)

Unified Diff: logdog/appengine/coordinator/service.go

Issue 2626433004: Move "common/config" common types into cfgtypes. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « logdog/appengine/coordinator/project.go ('k') | logdog/client/butler/bootstrap/env.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/appengine/coordinator/service.go
diff --git a/logdog/appengine/coordinator/service.go b/logdog/appengine/coordinator/service.go
index 4a451e654eab64bb4be044ef7c373558988736f8..eec0aa638e8a4891e1bf66883f038556a9ac4cf1 100644
--- a/logdog/appengine/coordinator/service.go
+++ b/logdog/appengine/coordinator/service.go
@@ -11,7 +11,6 @@ import (
"github.com/luci/luci-go/appengine/gaeauth/server/gaesigner"
"github.com/luci/luci-go/common/clock"
- 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"
@@ -22,6 +21,7 @@ import (
"github.com/luci/luci-go/logdog/common/storage/archive"
"github.com/luci/luci-go/logdog/common/storage/bigtable"
"github.com/luci/luci-go/logdog/common/storage/caching"
+ "github.com/luci/luci-go/luci_config/common/cfgtypes"
"github.com/luci/luci-go/server/auth"
"github.com/luci/luci-go/server/router"
@@ -74,7 +74,7 @@ type Services interface {
// request.
//
// Returns the same error codes as config.ProjectConfig.
- ProjectConfig(context.Context, luciConfig.ProjectName) (*svcconfig.ProjectConfig, error)
+ ProjectConfig(context.Context, cfgtypes.ProjectName) (*svcconfig.ProjectConfig, error)
// Storage returns a Storage instance for the supplied log stream.
//
@@ -108,7 +108,7 @@ type prodServicesInst struct {
// gcfg is the cached global configuration.
gcfg *config.Config
- projectConfigs map[luciConfig.ProjectName]*cachedProjectConfig
+ projectConfigs map[cfgtypes.ProjectName]*cachedProjectConfig
// archivalIndex is the atomically-manipulated archival index for the
// ArchivalPublisher. This is shared between all ArchivalPublisher instances
@@ -162,7 +162,7 @@ func (s *prodServicesInst) Config(c context.Context) (*config.Config, error) {
type cachedProjectConfig struct {
sync.Once
- project luciConfig.ProjectName
+ project cfgtypes.ProjectName
pcfg *svcconfig.ProjectConfig
err error
}
@@ -179,12 +179,12 @@ func (cp *cachedProjectConfig) resolve(c context.Context) (*svcconfig.ProjectCon
return cp.pcfg, cp.err
}
-func (s *prodServicesInst) getOrCreateCachedProjectConfig(project luciConfig.ProjectName) *cachedProjectConfig {
+func (s *prodServicesInst) getOrCreateCachedProjectConfig(project cfgtypes.ProjectName) *cachedProjectConfig {
s.Lock()
defer s.Unlock()
if s.projectConfigs == nil {
- s.projectConfigs = make(map[luciConfig.ProjectName]*cachedProjectConfig)
+ s.projectConfigs = make(map[cfgtypes.ProjectName]*cachedProjectConfig)
}
cp := s.projectConfigs[project]
if cp == nil {
@@ -196,7 +196,7 @@ func (s *prodServicesInst) getOrCreateCachedProjectConfig(project luciConfig.Pro
return cp
}
-func (s *prodServicesInst) ProjectConfig(c context.Context, project luciConfig.ProjectName) (*svcconfig.ProjectConfig, error) {
+func (s *prodServicesInst) ProjectConfig(c context.Context, project cfgtypes.ProjectName) (*svcconfig.ProjectConfig, error) {
return s.getOrCreateCachedProjectConfig(project).resolve(c)
}
« no previous file with comments | « logdog/appengine/coordinator/project.go ('k') | logdog/client/butler/bootstrap/env.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698