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

Side by Side Diff: service/datastore/testable.go

Issue 1372473002: Add the ability to disable special automatic entities in impl/memory (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: add more docstring 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 unified diff | Download patch
« no previous file with comments | « impl/memory/datastore_test.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package datastore 5 package datastore
6 6
7 // TestingSnapshot is an opaque implementation-defined snapshot type. 7 // TestingSnapshot is an opaque implementation-defined snapshot type.
8 type TestingSnapshot interface { 8 type TestingSnapshot interface {
9 ImATestingSnapshot() 9 ImATestingSnapshot()
10 } 10 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // CatchupIndexes or use Take/SetIndexSnapshot to manipulate the index s tate. 50 // CatchupIndexes or use Take/SetIndexSnapshot to manipulate the index s tate.
51 Consistent(always bool) 51 Consistent(always bool)
52 52
53 // AutoIndex controls the index creation behavior. If it is set to true, then 53 // AutoIndex controls the index creation behavior. If it is set to true, then
54 // any time the datastore encounters a missing index, it will silently c reate 54 // any time the datastore encounters a missing index, it will silently c reate
55 // one and allow the query to succeed. If it's false, then the query wil l 55 // one and allow the query to succeed. If it's false, then the query wil l
56 // return an error describing the index which could be added with AddInd exes. 56 // return an error describing the index which could be added with AddInd exes.
57 // 57 //
58 // By default this is false. 58 // By default this is false.
59 AutoIndex(bool) 59 AutoIndex(bool)
60
61 // DisableSpecialEntities turns off maintenance of special __entity_grou p__
62 // type entities. By default this mainenance is enabled, but it can be
63 // disabled by calling this with true.
64 //
65 // If it's true:
66 // - AllocateIDs returns an error.
67 // - Put'ing incomplete Keys returns an error.
68 // - Transactions are disabled and will return an error.
69 //
70 // This is mainly only useful when using an embedded in-memory datastore as
71 // a fully-consistent 'datastore-lite'. In particular, this is useful fo r the
72 // txnBuf filter which uses it to fulfil queries in a buffered transacti on,
73 // but never wants the in-memory versions of these entities to bleed thr ough
74 // to the user code.
75 DisableSpecialEntities(bool)
60 } 76 }
OLDNEW
« no previous file with comments | « impl/memory/datastore_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698