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

Unified Diff: go/src/infra/gae/libs/wrapper/memory/globalinfo.go

Issue 1230303003: Revert "Refactor current GAE abstraction library to be free of the SDK*" (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 5 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: go/src/infra/gae/libs/wrapper/memory/globalinfo.go
diff --git a/go/src/infra/gae/libs/gae/memory/globalinfo.go b/go/src/infra/gae/libs/wrapper/memory/globalinfo.go
similarity index 51%
rename from go/src/infra/gae/libs/gae/memory/globalinfo.go
rename to go/src/infra/gae/libs/wrapper/memory/globalinfo.go
index 13199ff6ac22beb762f6e98c8f99a65c46bdde1a..397e9def6820e15582ff895a313e3b2004469e06 100644
--- a/go/src/infra/gae/libs/gae/memory/globalinfo.go
+++ b/go/src/infra/gae/libs/wrapper/memory/globalinfo.go
@@ -5,9 +5,9 @@
package memory
import (
- "golang.org/x/net/context"
+ "infra/gae/libs/wrapper"
- "infra/gae/libs/gae"
+ "golang.org/x/net/context"
)
type giContextKeyType int
@@ -18,34 +18,24 @@ func curGID(c context.Context) *globalInfoData {
return c.Value(giContextKey).(*globalInfoData)
}
-// useGI adds a gae.GlobalInfo context, accessible
-// by gae.GetGI(c)
+// useGI adds a wrapper.GlobalInfo context, accessible
+// by wrapper.GetGI(c)
func useGI(c context.Context) context.Context {
- return gae.SetGIFactory(c, func(ic context.Context) gae.GlobalInfo {
- return &giImpl{gae.DummyGI(), curGID(ic), ic}
+ return wrapper.SetGIFactory(c, func(ic context.Context) wrapper.GlobalInfo {
+ return &giImpl{wrapper.DummyGI(), 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"
-
type globalInfoData struct{ namespace string }
type giImpl struct {
- gae.GlobalInfo
+ wrapper.GlobalInfo
data *globalInfoData
c context.Context
}
-var _ = gae.GlobalInfo((*giImpl)(nil))
+var _ = wrapper.GlobalInfo((*giImpl)(nil))
func (gi *giImpl) Namespace(ns string) (context.Context, error) {
return context.WithValue(gi.c, giContextKey, &globalInfoData{ns}), nil
}
-
-func (gi *giImpl) AppID() string {
- return globalAppID
-}
« no previous file with comments | « go/src/infra/gae/libs/wrapper/memory/gkvlite_utils_test.go ('k') | go/src/infra/gae/libs/wrapper/memory/internal/goon/goon.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698