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

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

Issue 1226063003: Move dummy service implementations into their own package. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@abstract
Patch Set: move mathrand test 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/gae/memory/raw_datstore.go
diff --git a/go/src/infra/gae/libs/gae/memory/raw_datstore.go b/go/src/infra/gae/libs/gae/memory/raw_datstore.go
index bea0f8f84430e96b6ea17f99ed77a5b2e489a0a4..a123bd107685c528bdfa33dc764117c3ff168a53 100644
--- a/go/src/infra/gae/libs/gae/memory/raw_datstore.go
+++ b/go/src/infra/gae/libs/gae/memory/raw_datstore.go
@@ -7,26 +7,26 @@ package memory
import (
"errors"
"fmt"
- "infra/gae/libs/gae"
-
"golang.org/x/net/context"
+ "infra/gae/libs/gae"
+ "infra/gae/libs/gae/dummy"
"infra/gae/libs/gae/helper"
)
//////////////////////////////////// public ////////////////////////////////////
-// useDS adds a gae.Datastore implementation to context, accessible
+// useRDS adds a gae.Datastore implementation to context, accessible
// by gae.GetDS(c)
-func useDS(c context.Context) context.Context {
+func useRDS(c context.Context) context.Context {
return gae.SetRDSFactory(c, func(ic context.Context) gae.RawDatastore {
dsd := cur(ic).Get(memContextDSIdx)
switch x := dsd.(type) {
case *dataStoreData:
- return &dsImpl{gae.DummyRDS(), x, curGID(ic).namespace, ic}
+ return &dsImpl{dummy.RDS(), x, curGID(ic).namespace, ic}
case *txnDataStoreData:
- return &txnDsImpl{gae.DummyRDS(), x, curGID(ic).namespace}
+ return &txnDsImpl{dummy.RDS(), x, curGID(ic).namespace}
default:
panic(fmt.Errorf("DS: bad type: %v in context %v", dsd, ic))
}
@@ -95,7 +95,7 @@ var (
)
func (d *dsImpl) NewQuery(kind string) gae.DSQuery {
- return &queryImpl{DSQuery: gae.DummyQY(), ns: d.ns, kind: kind}
+ return &queryImpl{DSQuery: dummy.QY(), ns: d.ns, kind: kind}
}
func (d *dsImpl) Run(q gae.DSQuery) gae.DSIterator {

Powered by Google App Engine
This is Rietveld 408576698