| OLD | NEW |
| 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" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 subscriptionErrorDelay = 10 * time.Second | 50 subscriptionErrorDelay = 10 * time.Second |
| 51 ) | 51 ) |
| 52 | 52 |
| 53 // application is the Archivist application state. | 53 // application is the Archivist application state. |
| 54 type application struct { | 54 type application struct { |
| 55 service.Service | 55 service.Service |
| 56 } | 56 } |
| 57 | 57 |
| 58 // run is the main execution function. | 58 // run is the main execution function. |
| 59 func (a *application) runArchivist(c context.Context) error { | 59 func (a *application) runArchivist(c context.Context) error { |
| 60 » cfg := a.Config() | 60 » cfg := a.ServiceConfig() |
| 61 | 61 |
| 62 coordCfg, acfg := cfg.GetCoordinator(), cfg.GetArchivist() | 62 coordCfg, acfg := cfg.GetCoordinator(), cfg.GetArchivist() |
| 63 switch { | 63 switch { |
| 64 case coordCfg == nil: | 64 case coordCfg == nil: |
| 65 fallthrough | 65 fallthrough |
| 66 | 66 |
| 67 case acfg == nil: | 67 case acfg == nil: |
| 68 return errors.New("missing required config: archivist") | 68 return errors.New("missing required config: archivist") |
| 69 case acfg.GsStagingBucket == "": | 69 case acfg.GsStagingBucket == "": |
| 70 return errors.New("missing required config: archivist.gs_staging
_bucket") | 70 return errors.New("missing required config: archivist.gs_staging
_bucket") |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |