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

Unified Diff: service/datastore/raw_interface.go

Issue 1292913002: Split off serialization and key functions to their own packages. (Closed) Base URL: https://github.com/luci/gae.git@make_queries_better
Patch Set: rebase Created 5 years, 4 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/pls_test.go ('k') | service/datastore/serialize.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 a3db860d9587acaff05075cdecc1d557eb664fc7..e9c77c6924433fe29bfaa21dbeaa90a31a62ffbf 100644
--- a/service/datastore/raw_interface.go
+++ b/service/datastore/raw_interface.go
@@ -21,6 +21,23 @@ type Key interface {
AppID() string
Namespace() string
+ // Incomplete returns true iff k doesn't have an id yet.
+ Incomplete() bool
+
+ // Valid determines if a key is valid, according to a couple rules:
+ // - k is not nil
+ // - every token of k:
+ // - (if !allowSpecial) token's kind doesn't start with '__'
+ // - token's kind and appid are non-blank
+ // - token is not incomplete
+ // - all tokens have the same namespace and appid
+ Valid(allowSpecial bool, aid, ns string) bool
+
+ // PartialValid determines if a key is valid for a Put operation. This is
+ // like Valid(false, aid, ns), except that the childmost key is allowed to
+ // be Incomplete().
+ PartialValid(aid, ns string) bool
+
String() string
}
« no previous file with comments | « service/datastore/pls_test.go ('k') | service/datastore/serialize.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698