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

Unified Diff: service/rawdatastore/types.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
« service/datastore/pls.go ('K') | « service/rawdatastore/serialize_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/rawdatastore/types.go
diff --git a/service/rawdatastore/types.go b/service/rawdatastore/types.go
deleted file mode 100644
index 42c127af0c6fcd37ca0e5c3b37ed28016ab8d517..0000000000000000000000000000000000000000
--- a/service/rawdatastore/types.go
+++ /dev/null
@@ -1,67 +0,0 @@
-// 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
-
-import (
- "fmt"
-)
-
-// 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
-}
-
-// Toggle is a tri-state boolean (Auto/True/False), which allows structs
-// to control boolean flags for metadata in a non-ambiguous way.
-type Toggle byte
-
-// These are the allowed values for Toggle. Any other values are invalid.
-const (
- Auto Toggle = iota
- On
- Off
-)
-
-func (b Toggle) String() string {
- switch b {
- case Auto:
- return "Auto"
- case On:
- return "On"
- case Off:
- return "Off"
- default:
- return fmt.Sprintf("UNKNOWN_Toggle(%d)", b)
- }
-}
« service/datastore/pls.go ('K') | « service/rawdatastore/serialize_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698