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

Side by Side Diff: doc.go

Issue 1285703002: Add testable interface for datastore. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: fixes after Raw change 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 unified diff | Download patch
« no previous file with comments | « no previous file | filter/count/rds.go » ('j') | 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 gae provides a fakable wrapped interface for the appengine SDK's 5 // Package gae provides a fakable wrapped interface for the appengine SDK's
6 // APIs. This means that it's possible to mock all of the supported appengine 6 // APIs. This means that it's possible to mock all of the supported appengine
7 // APIs for testing (or potentially implement a different backend for them). 7 // APIs for testing (or potentially implement a different backend for them).
8 // 8 //
9 // Features 9 // Features
10 // 10 //
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // 102 //
103 // service.RawInterface - the internal service interface used by service 103 // service.RawInterface - the internal service interface used by service
104 // and filter implementations. Note that some services 104 // and filter implementations. Note that some services
105 // like Info don't distinguish between the service 105 // like Info don't distinguish between the service
106 // interface and the user interface. This interface is 106 // interface and the user interface. This interface is
107 // typically a bit lower level than Interface and 107 // typically a bit lower level than Interface and
108 // lacks convenience methods. 108 // lacks convenience methods.
109 // 109 //
110 // service.Testable - any additional methods that a 'testing' 110 // service.Testable - any additional methods that a 'testing'
111 // implementation should provide. This can be accessed 111 // implementation should provide. This can be accessed
112 // via the Testable method on Interface or 112 // via the Testable method on RawInterface. If the
113 // RawInterface. If the current implementation is not 113 // current implementation is not testable, it will
114 // testable, it will return nil. This is only meant to 114 // return nil. This is only meant to be accessed when
115 // be accessed when testing. 115 // testing.
116 // 116 //
117 // service.RawFactory - a function returning a RawInterface 117 // service.RawFactory - a function returning a RawInterface
118 // 118 //
119 // service.RawFilter - a function returning a new RawInterface based on 119 // service.RawFilter - a function returning a new RawInterface based on
120 // the previous filtered interface. Filters chain 120 // the previous filtered interface. Filters chain
121 // together to allow behavioral service features 121 // together to allow behavioral service features
122 // without needing to agument the underlying service 122 // without needing to agument the underlying service
123 // implementations directly. 123 // implementations directly.
124 // 124 //
125 // And common functions are: 125 // And common functions are:
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // and the state can be observed to see how many times each API was invoked. 217 // and the state can be observed to see how many times each API was invoked.
218 // Since filters stack, we can compare counts from rawCount versus userCount to 218 // Since filters stack, we can compare counts from rawCount versus userCount to
219 // see how many calls to the actual real datastore went through, vs. how many 219 // see how many calls to the actual real datastore went through, vs. how many
220 // went to memcache, for example. 220 // went to memcache, for example.
221 // 221 //
222 // Note that Filters apply only to the service.RawInterface. All implementations 222 // Note that Filters apply only to the service.RawInterface. All implementations
223 // of service.Interface boil down to calls to service.RawInterface methods, but 223 // of service.Interface boil down to calls to service.RawInterface methods, but
224 // it's possible that bad calls to the service.Interface methods could return 224 // it's possible that bad calls to the service.Interface methods could return
225 // an error before ever reaching the filters or service implementation. 225 // an error before ever reaching the filters or service implementation.
226 package gae 226 package gae
OLDNEW
« no previous file with comments | « no previous file | filter/count/rds.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698