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

Side by Side Diff: appengine/logdog/coordinator/coordinatorTest/config.go

Issue 1863973002: LogDog: Update to archival V2. (Closed) Base URL: https://github.com/luci/luci-go@grpcutil-errors
Patch Set: Code review comments, use Pub/Sub, archival staging, quality of life. Created 4 years, 8 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package coordinatorTest
6
7 import (
8 "fmt"
9
10 "github.com/golang/protobuf/proto"
11 "github.com/luci/luci-go/appengine/logdog/coordinator/config"
12 "github.com/luci/luci-go/common/config/impl/memory"
13 "github.com/luci/luci-go/common/proto/logdog/svcconfig"
14 "github.com/luci/luci-go/server/settings"
15 "golang.org/x/net/context"
16 )
17
18 // UseConfig installs a Coordinator configuration into the current context.
19 func UseConfig(c context.Context, cc *svcconfig.Coordinator) context.Context {
20 c = settings.Use(c, settings.New(&settings.MemoryStorage{}))
21 gcfg := config.GlobalConfig{
22 ConfigServiceURL: "https://example.com",
23 ConfigSet: "services/logdog-test",
24 ConfigPath: "coordinator-test.cfg",
25 }
26 if err := gcfg.Store(c, "test setup"); err != nil {
27 panic(fmt.Errorf("failed to store test configuration: %v", err))
28 }
29
30 cmap := map[string]memory.ConfigSet{
31 "services/logdog-test": map[string]string{},
32 }
33 if cc != nil {
34 cfg := svcconfig.Config{
35 Coordinator: cc,
36 }
37 cmap["services/logdog-test"]["coordinator-test.cfg"] = proto.Mar shalTextString(&cfg)
38 }
39 return memory.Use(c, cmap)
40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698