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

Unified Diff: impl/memory/info.go

Issue 1309803004: Add transaction buffer filter. (Closed) Base URL: https://github.com/luci/gae.git@add_query_support
Patch Set: make data flow clearer, implement Count Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: impl/memory/info.go
diff --git a/impl/memory/info.go b/impl/memory/info.go
index a52d02ab5d7c82ecc33949f173150deb1b2c6427..4f8fb8b43aef0a1fba518ad290ebbeedbddc4bac 100644
--- a/impl/memory/info.go
+++ b/impl/memory/info.go
@@ -26,19 +26,14 @@ func curGID(c context.Context) *globalInfoData {
// useGI adds a gae.GlobalInfo context, accessible
// by gae.GetGI(c)
-func useGI(c context.Context) context.Context {
+func useGI(c context.Context, appID string) context.Context {
return info.SetFactory(c, func(ic context.Context) info.Interface {
return &giImpl{dummy.Info(), curGID(ic), ic}
})
}
-// globalAppID is the 'AppID' of everythin returned from this memory
-// implementation (DSKeys, GlobalInfo, etc.). There's no way to modify this
-// value through the API, and there are a couple bits of code where it's hard to
-// route this value through to without making the internal APIs really complex.
-const globalAppID = "dev~app"
iannucci 2015/09/29 04:43:27 routed through the internal apis :)
-
type globalInfoData struct {
+ appid string
namespace string
}
@@ -58,15 +53,15 @@ func (gi *giImpl) Namespace(ns string) (ret context.Context, err error) {
if !validNamespace.MatchString(ns) {
return nil, fmt.Errorf("appengine: namespace %q does not match /%s/", ns, validNamespace)
}
- return context.WithValue(gi.c, giContextKey, &globalInfoData{ns}), nil
+ return context.WithValue(gi.c, giContextKey, &globalInfoData{gi.appid, ns}), nil
}
func (gi *giImpl) AppID() string {
- return globalAppID
+ return gi.appid
}
func (gi *giImpl) FullyQualifiedAppID() string {
- return globalAppID
+ return gi.appid
}
func (gi *giImpl) IsDevAppServer() bool {

Powered by Google App Engine
This is Rietveld 408576698