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

Unified Diff: go/src/infra/gae/libs/wrapper/memory/context.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/context.go
diff --git a/go/src/infra/gae/libs/gae/memory/context.go b/go/src/infra/gae/libs/wrapper/memory/context.go
similarity index 93%
rename from go/src/infra/gae/libs/gae/memory/context.go
rename to go/src/infra/gae/libs/wrapper/memory/context.go
index 2df9556240449c8e347dba0bf6a4ac1e7ce42f5d..b6607fcc4d0231f8b23874083be039c09a157545 100644
--- a/go/src/infra/gae/libs/gae/memory/context.go
+++ b/go/src/infra/gae/libs/wrapper/memory/context.go
@@ -10,7 +10,7 @@ import (
"golang.org/x/net/context"
- "infra/gae/libs/gae"
+ "appengine/datastore"
)
type memContextObj interface {
@@ -19,7 +19,7 @@ type memContextObj interface {
applyTxn(c context.Context, m memContextObj)
endTxn()
- mkTxn(*gae.DSTransactionOptions) (memContextObj, error)
+ mkTxn(*datastore.TransactionOptions) (memContextObj, error)
}
type memContext []memContextObj
@@ -62,7 +62,7 @@ func (m memContext) endTxn() {
}
}
-func (m memContext) mkTxn(o *gae.DSTransactionOptions) (memContextObj, error) {
+func (m memContext) mkTxn(o *datastore.TransactionOptions) (memContextObj, error) {
ret := make(memContext, len(m))
for i, itm := range m {
newItm, err := itm.mkTxn(o)
@@ -137,7 +137,7 @@ var memContextKey memContextKeyType
// fake TaskQueue is NOT backed by the fake Datastore. This is done to make the
// test-access API for TaskQueue better (instead of trying to reconstitute the
// state of the task queue from a bunch of datastore accesses).
-func (d *dsImpl) RunInTransaction(f func(context.Context) error, o *gae.DSTransactionOptions) error {
+func (d *dsImpl) RunInTransaction(f func(context.Context) error, o *datastore.TransactionOptions) error {
curMC := cur(d.c)
txnMC, err := curMC.mkTxn(o)
@@ -162,7 +162,7 @@ func (d *dsImpl) RunInTransaction(f func(context.Context) error, o *gae.DSTransa
if curMC.canApplyTxn(txnMC) {
curMC.applyTxn(d.c, txnMC)
} else {
- return gae.ErrDSConcurrentTransaction
+ return datastore.ErrConcurrentTransaction
}
return nil
}
« no previous file with comments | « go/src/infra/gae/libs/wrapper/memory/binutils_test.go ('k') | go/src/infra/gae/libs/wrapper/memory/datastore.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698