OLD | NEW |
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // service.Interface - the main user-friendly service interface. | 101 // service.Interface - the main user-friendly service interface. |
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. It's expected that | 111 // implementation should provide. This can be accessed |
112 // tests will cast the RawInterface from GetRaw() to | 112 // via the Testable method on Interface or |
113 // Testable in order to access these methods. | 113 // RawInterface. If the current implementation is not |
| 114 // testable, it will return nil. This is only meant to |
| 115 // be accessed when testing. |
114 // | 116 // |
115 // service.RawFactory - a function returning a RawInterface | 117 // service.RawFactory - a function returning a RawInterface |
116 // | 118 // |
117 // service.RawFilter - a function returning a new RawInterface based on | 119 // service.RawFilter - a function returning a new RawInterface based on |
118 // the previous filtered interface. Filters chain | 120 // the previous filtered interface. Filters chain |
119 // together to allow behavioral service features | 121 // together to allow behavioral service features |
120 // without needing to agument the underlying service | 122 // without needing to agument the underlying service |
121 // implementations directly. | 123 // implementations directly. |
122 // | 124 // |
123 // And common functions are: | 125 // And common functions are: |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // 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. |
216 // 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 |
217 // 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 |
218 // went to memcache, for example. | 220 // went to memcache, for example. |
219 // | 221 // |
220 // Note that Filters apply only to the service.RawInterface. All implementations | 222 // Note that Filters apply only to the service.RawInterface. All implementations |
221 // 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 |
222 // 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 |
223 // an error before ever reaching the filters or service implementation. | 225 // an error before ever reaching the filters or service implementation. |
224 package gae | 226 package gae |
OLD | NEW |