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

Side by Side Diff: logdog/server/cmd/logdog_archivist/main.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 unified diff | Download patch
« no previous file with comments | « logdog/server/archivist/storageSource.go ('k') | logdog/server/collector/collector.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The LUCI Authors. All rights reserved. 1 // Copyright 2016 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 import ( 7 import (
8 "time" 8 "time"
9 9
10 "github.com/luci/luci-go/common/auth" 10 "github.com/luci/luci-go/common/auth"
11 "github.com/luci/luci-go/common/clock" 11 "github.com/luci/luci-go/common/clock"
12 "github.com/luci/luci-go/common/config"
13 "github.com/luci/luci-go/common/errors" 12 "github.com/luci/luci-go/common/errors"
14 "github.com/luci/luci-go/common/gcloud/gs" 13 "github.com/luci/luci-go/common/gcloud/gs"
15 gcps "github.com/luci/luci-go/common/gcloud/pubsub" 14 gcps "github.com/luci/luci-go/common/gcloud/pubsub"
16 log "github.com/luci/luci-go/common/logging" 15 log "github.com/luci/luci-go/common/logging"
17 "github.com/luci/luci-go/common/sync/parallel" 16 "github.com/luci/luci-go/common/sync/parallel"
18 "github.com/luci/luci-go/common/tsmon/distribution" 17 "github.com/luci/luci-go/common/tsmon/distribution"
19 "github.com/luci/luci-go/common/tsmon/field" 18 "github.com/luci/luci-go/common/tsmon/field"
20 "github.com/luci/luci-go/common/tsmon/metric" 19 "github.com/luci/luci-go/common/tsmon/metric"
21 "github.com/luci/luci-go/common/tsmon/types" 20 "github.com/luci/luci-go/common/tsmon/types"
22 "github.com/luci/luci-go/logdog/api/config/svcconfig" 21 "github.com/luci/luci-go/logdog/api/config/svcconfig"
23 "github.com/luci/luci-go/logdog/server/archivist" 22 "github.com/luci/luci-go/logdog/server/archivist"
24 "github.com/luci/luci-go/logdog/server/service" 23 "github.com/luci/luci-go/logdog/server/service"
24 "github.com/luci/luci-go/luci_config/common/cfgtypes"
25 25
26 "cloud.google.com/go/pubsub" 26 "cloud.google.com/go/pubsub"
27 "golang.org/x/net/context" 27 "golang.org/x/net/context"
28 "google.golang.org/api/iterator" 28 "google.golang.org/api/iterator"
29 "google.golang.org/api/option" 29 "google.golang.org/api/option"
30 ) 30 )
31 31
32 var ( 32 var (
33 errInvalidConfig = errors.New("invalid configuration") 33 errInvalidConfig = errors.New("invalid configuration")
34 34
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 return nil 212 return nil
213 } 213 }
214 214
215 // GetSettingsLoader is an archivist.SettingsLoader implementation that merges 215 // GetSettingsLoader is an archivist.SettingsLoader implementation that merges
216 // global and project-specific settings. 216 // global and project-specific settings.
217 // 217 //
218 // The resulting settings object will be verified by the Archivist. 218 // The resulting settings object will be verified by the Archivist.
219 func (a *application) GetSettingsLoader(acfg *svcconfig.Archivist) archivist.Set tingsLoader { 219 func (a *application) GetSettingsLoader(acfg *svcconfig.Archivist) archivist.Set tingsLoader {
220 serviceID := a.ServiceID() 220 serviceID := a.ServiceID()
221 221
222 » return func(c context.Context, proj config.ProjectName) (*archivist.Sett ings, error) { 222 » return func(c context.Context, proj cfgtypes.ProjectName) (*archivist.Se ttings, error) {
223 // Fold in our project-specific configuration, if valid. 223 // Fold in our project-specific configuration, if valid.
224 pcfg, err := a.ProjectConfig(c, proj) 224 pcfg, err := a.ProjectConfig(c, proj)
225 if err != nil { 225 if err != nil {
226 log.Fields{ 226 log.Fields{
227 log.ErrorKey: err, 227 log.ErrorKey: err,
228 "project": proj, 228 "project": proj,
229 }.Errorf(c, "Failed to fetch project configuration.") 229 }.Errorf(c, "Failed to fetch project configuration.")
230 return nil, err 230 return nil, err
231 } 231 }
232 232
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 268
269 // Entry point. 269 // Entry point.
270 func main() { 270 func main() {
271 a := application{ 271 a := application{
272 Service: service.Service{ 272 Service: service.Service{
273 Name: "archivist", 273 Name: "archivist",
274 }, 274 },
275 } 275 }
276 a.Run(context.Background(), a.runArchivist) 276 a.Run(context.Background(), a.runArchivist)
277 } 277 }
OLDNEW
« no previous file with comments | « logdog/server/archivist/storageSource.go ('k') | logdog/server/collector/collector.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698