Index: service/rawdatastore/types.go |
diff --git a/service/rawdatastore/types.go b/service/rawdatastore/types.go |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9b426ad3ff4e35db1ba2213610aa9b6c37aae61d |
--- /dev/null |
+++ b/service/rawdatastore/types.go |
@@ -0,0 +1,39 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package rawdatastore |
+ |
+// ByteString is a short byte slice (up to 1500 bytes) that can be indexed. |
+type ByteString []byte |
+ |
+// GeoPoint represents a location as latitude/longitude in degrees. |
+// |
+// You probably shouldn't use these, but their inclusion here is so that the |
+// RawDatastore can interact (and round-trip) correctly with other datastore API |
+// implementations. |
+type GeoPoint struct { |
+ Lat, Lng float64 |
+} |
+ |
+// Valid returns whether a GeoPoint is within [-90, 90] latitude and [-180, |
+// 180] longitude. |
+func (g GeoPoint) Valid() bool { |
+ return -90 <= g.Lat && g.Lat <= 90 && -180 <= g.Lng && g.Lng <= 180 |
+} |
+ |
+// TransactionOptions are the options for running a transaction. |
+type TransactionOptions struct { |
+ // XG is whether the transaction can cross multiple entity groups. In |
+ // comparison, a single group transaction is one where all datastore keys |
+ // used have the same root key. Note that cross group transactions do not |
+ // have the same behavior as single group transactions. In particular, it |
+ // is much more likely to see partially applied transactions in different |
+ // entity groups, in global queries. |
+ // It is valid to set XG to true even if the transaction is within a |
+ // single entity group. |
+ XG bool |
+ // Attempts controls the number of retries to perform when commits fail |
+ // due to a conflicting transaction. If omitted, it defaults to 3. |
+ Attempts int |
+} |