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

Side by Side Diff: luci_config/appengine/format/context.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
(Empty)
1 // Copyright 2016 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file.
4
5 package format
6
7 import (
8 "github.com/luci/luci-go/luci_config/server/cfgclient"
9
10 "golang.org/x/net/context"
11 )
12
13 var formatRegistryKey = "github.com/luci/luci-go/luci_config/appengine/format:Fo rmatRegistry"
14
15 // WithRegistry returns a Context with the supplied FormatterRegistry embedded
16 // into it.
17 func WithRegistry(c context.Context, fr *cfgclient.FormatterRegistry) context.Co ntext {
18 return context.WithValue(c, &formatRegistryKey, fr)
19 }
20
21 // GetRegistry is used to retrieve the config service format registry from the
22 // supplied Context.
23 func GetRegistry(c context.Context) *cfgclient.FormatterRegistry {
24 return c.Value(&formatRegistryKey).(*cfgclient.FormatterRegistry)
25 }
OLDNEW
« no previous file with comments | « luci_config/appengine/backend/memcache/cache_test.go ('k') | luci_config/appengine/format/default.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698