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

Unified Diff: filter/count/rds.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: filter/count/rds.go
diff --git a/filter/count/rds.go b/filter/count/rds.go
index cff7b0b6b458c179f1b42fad9c9c9a68c0a86544..41d1861055f424de9c99c20f84e8b62f9ce68f22 100644
--- a/filter/count/rds.go
+++ b/filter/count/rds.go
@@ -7,7 +7,7 @@ package count
import (
"golang.org/x/net/context"
- rds "github.com/luci/gae/service/rawdatastore"
+ ds "github.com/luci/gae/service/datastore"
)
// RDSCounter is the counter object for the RawDatastore service.
@@ -25,50 +25,50 @@ type RDSCounter struct {
type rdsCounter struct {
c *RDSCounter
- rds rds.Interface
+ ds ds.RawInterface
}
-var _ rds.Interface = (*rdsCounter)(nil)
+var _ ds.RawInterface = (*rdsCounter)(nil)
-func (r *rdsCounter) NewKey(kind, stringID string, intID int64, parent rds.Key) rds.Key {
+func (r *rdsCounter) NewKey(kind, stringID string, intID int64, parent ds.Key) ds.Key {
r.c.NewKey.up()
- return r.rds.NewKey(kind, stringID, intID, parent)
+ return r.ds.NewKey(kind, stringID, intID, parent)
}
-func (r *rdsCounter) DecodeKey(encoded string) (rds.Key, error) {
- ret, err := r.rds.DecodeKey(encoded)
+func (r *rdsCounter) DecodeKey(encoded string) (ds.Key, error) {
+ ret, err := r.ds.DecodeKey(encoded)
return ret, r.c.DecodeKey.up(err)
}
-func (r *rdsCounter) NewQuery(kind string) rds.Query {
+func (r *rdsCounter) NewQuery(kind string) ds.Query {
r.c.NewQuery.up()
- return r.rds.NewQuery(kind)
+ return r.ds.NewQuery(kind)
}
-func (r *rdsCounter) Run(q rds.Query, cb rds.RunCB) error {
- return r.c.Run.up(r.rds.Run(q, cb))
+func (r *rdsCounter) Run(q ds.Query, cb ds.RawRunCB) error {
+ return r.c.Run.up(r.ds.Run(q, cb))
}
-func (r *rdsCounter) RunInTransaction(f func(context.Context) error, opts *rds.TransactionOptions) error {
- return r.c.RunInTransaction.up(r.rds.RunInTransaction(f, opts))
+func (r *rdsCounter) RunInTransaction(f func(context.Context) error, opts *ds.TransactionOptions) error {
+ return r.c.RunInTransaction.up(r.ds.RunInTransaction(f, opts))
}
-func (r *rdsCounter) DeleteMulti(keys []rds.Key, cb rds.DeleteMultiCB) error {
- return r.c.DeleteMulti.up(r.rds.DeleteMulti(keys, cb))
+func (r *rdsCounter) DeleteMulti(keys []ds.Key, cb ds.DeleteMultiCB) error {
+ return r.c.DeleteMulti.up(r.ds.DeleteMulti(keys, cb))
}
-func (r *rdsCounter) GetMulti(keys []rds.Key, cb rds.GetMultiCB) error {
- return r.c.GetMulti.up(r.rds.GetMulti(keys, cb))
+func (r *rdsCounter) GetMulti(keys []ds.Key, cb ds.GetMultiCB) error {
+ return r.c.GetMulti.up(r.ds.GetMulti(keys, cb))
}
-func (r *rdsCounter) PutMulti(keys []rds.Key, vals []rds.PropertyLoadSaver, cb rds.PutMultiCB) error {
- return r.c.PutMulti.up(r.rds.PutMulti(keys, vals, cb))
+func (r *rdsCounter) PutMulti(keys []ds.Key, vals []ds.PropertyMap, cb ds.PutMultiCB) error {
+ return r.c.PutMulti.up(r.ds.PutMulti(keys, vals, cb))
}
// FilterRDS installs a counter RawDatastore filter in the context.
func FilterRDS(c context.Context) (context.Context, *RDSCounter) {
state := &RDSCounter{}
- return rds.AddFilters(c, func(ic context.Context, rds rds.Interface) rds.Interface {
- return &rdsCounter{state, rds}
+ return ds.AddRawFilters(c, func(ic context.Context, ds ds.RawInterface) ds.RawInterface {
+ return &rdsCounter{state, ds}
}), state
}

Powered by Google App Engine
This is Rietveld 408576698