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

Unified Diff: service/datastore/interface.go

Issue 1357343002: Add missing AllocateIDs API. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: add panic Created 5 years, 3 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 | « service/datastore/checkfilter.go ('k') | service/datastore/raw_interface.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/interface.go
diff --git a/service/datastore/interface.go b/service/datastore/interface.go
index e547bfb3fbb23e7015e32e1279ae5c26fe91c1a8..c52e8b02010918c4704c7cc40439e8633006bed7 100644
--- a/service/datastore/interface.go
+++ b/service/datastore/interface.go
@@ -20,6 +20,14 @@ import (
// Struct objects passed in will be converted to PropertyLoadSaver interfaces
// using this package's GetPLS function.
type Interface interface {
+ // AllocateIDs allows you to allocate IDs from the datastore without putting
+ // any data. `incomplete` must be a PartialValid Key. If there's no error,
+ // a contiguous block of IDs of n length starting at `start` will be reserved
+ // indefinitely for the user application code for use in new keys. The
+ // appengine automatic ID generator will never automatically assign these IDs
+ // for Keys of this type.
+ AllocateIDs(incomplete *Key, n int) (start int64, err error)
+
// KeyForObj extracts a key from src.
//
// It is the same as KeyForObjErr, except that if KeyForObjErr would have
« no previous file with comments | « service/datastore/checkfilter.go ('k') | service/datastore/raw_interface.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698