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

Unified Diff: impl/prod/datastore_key.go

Issue 1259593005: Add 'user friendly' datastore API. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: 100% coverage of new code 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: impl/prod/datastore_key.go
diff --git a/impl/prod/datastore_key.go b/impl/prod/datastore_key.go
index b2e93937147ee70209db6a0c6dc6b9e98889bd35..fde1c970f405b0dbb3e5eba12576089aceb55c5a 100644
--- a/impl/prod/datastore_key.go
+++ b/impl/prod/datastore_key.go
@@ -5,7 +5,7 @@
package prod
import (
- rds "github.com/luci/gae/service/rawdatastore"
+ ds "github.com/luci/gae/service/datastore"
"google.golang.org/appengine/datastore"
)
@@ -13,23 +13,23 @@ type dsKeyImpl struct {
*datastore.Key
}
-var _ rds.Key = dsKeyImpl{}
+var _ ds.Key = dsKeyImpl{}
-func (k dsKeyImpl) Parent() rds.Key { return dsR2F(k.Key.Parent()) }
+func (k dsKeyImpl) Parent() ds.Key { return dsR2F(k.Key.Parent()) }
-// dsR2F (DS real-to-fake) converts an SDK Key to a rds.Key
-func dsR2F(k *datastore.Key) rds.Key {
+// dsR2F (DS real-to-fake) converts an SDK Key to a ds.Key
+func dsR2F(k *datastore.Key) ds.Key {
return dsKeyImpl{k}
}
// dsF2R (DS fake-to-real) converts a DSKey back to an SDK *Key.
-func dsF2R(k rds.Key) *datastore.Key {
+func dsF2R(k ds.Key) *datastore.Key {
if rkey, ok := k.(dsKeyImpl); ok {
return rkey.Key
}
// we should always hit the fast case above, but just in case, safely round
// trip through the proto encoding.
- rkey, err := datastore.DecodeKey(rds.KeyEncode(k))
+ rkey, err := datastore.DecodeKey(ds.KeyEncode(k))
if err != nil {
// should never happen in a good program, but it's not ignorable, and
// passing an error back makes this function too cumbersome (and it causes
@@ -41,7 +41,7 @@ func dsF2R(k rds.Key) *datastore.Key {
}
// dsMF2R (DS multi-fake-to-fake) converts a slice of wrapped keys to SDK keys.
-func dsMF2R(ks []rds.Key) []*datastore.Key {
+func dsMF2R(ks []ds.Key) []*datastore.Key {
ret := make([]*datastore.Key, len(ks))
for i, k := range ks {
ret[i] = dsF2R(k)

Powered by Google App Engine
This is Rietveld 408576698