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

Side by Side Diff: logdog/appengine/coordinator/endpoints/services/getConfig.go

Issue 2575383002: Add server/cache support to gaeconfig. (Closed)
Patch Set: Un-collapse. 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
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 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 services 5 package services
6 6
7 import ( 7 import (
8 log "github.com/luci/luci-go/common/logging" 8 log "github.com/luci/luci-go/common/logging"
9 "github.com/luci/luci-go/common/proto/google" 9 "github.com/luci/luci-go/common/proto/google"
10 "github.com/luci/luci-go/grpc/grpcutil" 10 "github.com/luci/luci-go/grpc/grpcutil"
11 "github.com/luci/luci-go/logdog/api/endpoints/coordinator/services/v1" 11 "github.com/luci/luci-go/logdog/api/endpoints/coordinator/services/v1"
12 "github.com/luci/luci-go/logdog/appengine/coordinator" 12 "github.com/luci/luci-go/logdog/appengine/coordinator"
13 "golang.org/x/net/context" 13 "golang.org/x/net/context"
14 ) 14 )
15 15
16 // GetConfig allows a service to retrieve the current service configuration 16 // GetConfig allows a service to retrieve the current service configuration
17 // parameters. 17 // parameters.
18 func (s *server) GetConfig(c context.Context, req *google.Empty) (*logdog.GetCon figResponse, error) { 18 func (s *server) GetConfig(c context.Context, req *google.Empty) (*logdog.GetCon figResponse, error) {
19 gcfg, err := coordinator.GetServices(c).Config(c) 19 gcfg, err := coordinator.GetServices(c).Config(c)
20 if err != nil { 20 if err != nil {
21 log.Fields{ 21 log.Fields{
22 log.ErrorKey: err, 22 log.ErrorKey: err,
23 }.Errorf(c, "Failed to load configuration.") 23 }.Errorf(c, "Failed to load configuration.")
24 return nil, grpcutil.Internal 24 return nil, grpcutil.Internal
25 } 25 }
26 26
27 return &logdog.GetConfigResponse{ 27 return &logdog.GetConfigResponse{
28 ConfigServiceUrl: gcfg.ConfigServiceURL.String(), 28 ConfigServiceUrl: gcfg.ConfigServiceURL.String(),
29 » » ConfigSet: gcfg.ConfigSet, 29 » » ConfigSet: string(gcfg.ConfigSet),
30 ServiceConfigPath: gcfg.ServiceConfigPath, 30 ServiceConfigPath: gcfg.ServiceConfigPath,
31 }, nil 31 }, nil
32 } 32 }
OLDNEW
« no previous file with comments | « logdog/appengine/coordinator/endpoints/logs/service.go ('k') | logdog/appengine/coordinator/hierarchy/hierarchy.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698