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

Side by Side Diff: logdog/server/cmd/logdog_collector/main.go

Issue 2647083003: LogDog: Use luci_config/server packages for config (Closed)
Patch Set: Comments. 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/cmd/logdog_archivist/main.go ('k') | logdog/server/service/config/config.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 "fmt" 8 "fmt"
9 "time" 9 "time"
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 distribution.DefaultBucketer) 56 distribution.DefaultBucketer)
57 ) 57 )
58 58
59 // application is the Collector application state. 59 // application is the Collector application state.
60 type application struct { 60 type application struct {
61 service.Service 61 service.Service
62 } 62 }
63 63
64 // run is the main execution function. 64 // run is the main execution function.
65 func (a *application) runCollector(c context.Context) error { 65 func (a *application) runCollector(c context.Context) error {
66 » cfg := a.Config() 66 » cfg := a.ServiceConfig()
67 ccfg := cfg.GetCollector() 67 ccfg := cfg.GetCollector()
68 if ccfg == nil { 68 if ccfg == nil {
69 return errors.New("no collector configuration") 69 return errors.New("no collector configuration")
70 } 70 }
71 71
72 pscfg := cfg.GetTransport().GetPubsub() 72 pscfg := cfg.GetTransport().GetPubsub()
73 if pscfg == nil { 73 if pscfg == nil {
74 return errors.New("missing Pub/Sub configuration") 74 return errors.New("missing Pub/Sub configuration")
75 } 75 }
76 76
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 // Entry point. 222 // Entry point.
223 func main() { 223 func main() {
224 a := application{ 224 a := application{
225 Service: service.Service{ 225 Service: service.Service{
226 Name: "collector", 226 Name: "collector",
227 }, 227 },
228 } 228 }
229 a.Run(context.Background(), a.runCollector) 229 a.Run(context.Background(), a.runCollector)
230 } 230 }
OLDNEW
« no previous file with comments | « logdog/server/cmd/logdog_archivist/main.go ('k') | logdog/server/service/config/config.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698