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

Unified Diff: go/src/infra/gae/libs/gae/memory/context.go

Issue 1240573002: Reland: Refactor current GAE abstraction library to be free of the SDK* (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: expand coverage range to fit 32bit test expectations 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
« no previous file with comments | « go/src/infra/gae/libs/gae/memory/README.md ('k') | go/src/infra/gae/libs/gae/memory/datastore_query.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/gae/libs/gae/memory/context.go
diff --git a/go/src/infra/gae/libs/wrapper/memory/context.go b/go/src/infra/gae/libs/gae/memory/context.go
similarity index 93%
rename from go/src/infra/gae/libs/wrapper/memory/context.go
rename to go/src/infra/gae/libs/gae/memory/context.go
index b6607fcc4d0231f8b23874083be039c09a157545..2df9556240449c8e347dba0bf6a4ac1e7ce42f5d 100644
--- a/go/src/infra/gae/libs/wrapper/memory/context.go
+++ b/go/src/infra/gae/libs/gae/memory/context.go
@@ -10,7 +10,7 @@ import (
"golang.org/x/net/context"
- "appengine/datastore"
+ "infra/gae/libs/gae"
)
type memContextObj interface {
@@ -19,7 +19,7 @@ type memContextObj interface {
applyTxn(c context.Context, m memContextObj)
endTxn()
- mkTxn(*datastore.TransactionOptions) (memContextObj, error)
+ mkTxn(*gae.DSTransactionOptions) (memContextObj, error)
}
type memContext []memContextObj
@@ -62,7 +62,7 @@ func (m memContext) endTxn() {
}
}
-func (m memContext) mkTxn(o *datastore.TransactionOptions) (memContextObj, error) {
+func (m memContext) mkTxn(o *gae.DSTransactionOptions) (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 *datastore.TransactionOptions) error {
+func (d *dsImpl) RunInTransaction(f func(context.Context) error, o *gae.DSTransactionOptions) error {
curMC := cur(d.c)
txnMC, err := curMC.mkTxn(o)
@@ -162,7 +162,7 @@ func (d *dsImpl) RunInTransaction(f func(context.Context) error, o *datastore.Tr
if curMC.canApplyTxn(txnMC) {
curMC.applyTxn(d.c, txnMC)
} else {
- return datastore.ErrConcurrentTransaction
+ return gae.ErrDSConcurrentTransaction
}
return nil
}
« no previous file with comments | « go/src/infra/gae/libs/gae/memory/README.md ('k') | go/src/infra/gae/libs/gae/memory/datastore_query.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698