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

Unified Diff: service/datastore/raw_interface.go

Issue 1521823003: Clean up callback interfaces. (Closed) Base URL: https://github.com/luci/gae.git@extra
Patch Set: fixins Created 5 years 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 | « service/datastore/propertytype_string.go ('k') | service/datastore/reflect.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/raw_interface.go
diff --git a/service/datastore/raw_interface.go b/service/datastore/raw_interface.go
index eb7533f3775036af9d76efc1b576af407fd9439c..d19c65b59573300f05cff1fbf8d6c0217dce50c7 100644
--- a/service/datastore/raw_interface.go
+++ b/service/datastore/raw_interface.go
@@ -26,8 +26,10 @@ type CursorCB func() (Cursor, error)
// - key is the Key of the entity
// - val is the data of the entity (or nil, if the query was keys-only)
//
-// Return true to continue iterating through the query results, or false to stop.
-type RawRunCB func(key *Key, val PropertyMap, getCursor CursorCB) bool
+// Return nil to continue iterating through the query results, or an error to
+// stop. If you return the error `Stop`, then Run will stop the query and
+// return nil.
+type RawRunCB func(key *Key, val PropertyMap, getCursor CursorCB) error
// GetMultiCB is the callback signature provided to RawInterface.GetMulti
//
@@ -35,7 +37,7 @@ type RawRunCB func(key *Key, val PropertyMap, getCursor CursorCB) bool
// * It may be nil if some of the keys to the GetMulti were bad, since all
// keys are validated before the RPC occurs!
// - err is an error associated with this entity (e.g. ErrNoSuchEntity).
-type GetMultiCB func(val PropertyMap, err error)
+type GetMultiCB func(val PropertyMap, err error) error
// PutMultiCB is the callback signature provided to RawInterface.PutMulti
//
@@ -43,12 +45,12 @@ type GetMultiCB func(val PropertyMap, err error)
// * It may be nil if some of the keys/vals to the PutMulti were bad, since
// all keys are validated before the RPC occurs!
// - err is an error associated with putting this entity.
-type PutMultiCB func(key *Key, err error)
+type PutMultiCB func(key *Key, err error) error
// DeleteMultiCB is the callback signature provided to RawInterface.DeleteMulti
//
// - err is an error associated with deleting this entity.
-type DeleteMultiCB func(err error)
+type DeleteMultiCB func(err error) error
type nullMetaGetterType struct{}
« no previous file with comments | « service/datastore/propertytype_string.go ('k') | service/datastore/reflect.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698