 Chromium Code Reviews
 Chromium Code Reviews Issue 2302743002:
  Interface update, per-method Contexts.  (Closed)
    
  
    Issue 2302743002:
  Interface update, per-method Contexts.  (Closed) 
  | OLD | NEW | 
|---|---|
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 | 
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. | 
| 4 | 4 | 
| 5 package datastore | 5 package datastore | 
| 6 | 6 | 
| 7 import ( | 7 import ( | 
| 8 "fmt" | 8 "fmt" | 
| 9 | 9 | 
| 10 "golang.org/x/net/context" | 10 "golang.org/x/net/context" | 
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 // receives an error, it will immediately forward that error and stop | 177 // receives an error, it will immediately forward that error and stop | 
| 178 // subsequent callbacks. | 178 // subsequent callbacks. | 
| 179 // | 179 // | 
| 180 // NOTE: Implementations and filters are guaranteed that | 180 // NOTE: Implementations and filters are guaranteed that | 
| 181 // - len(keys) > 0 | 181 // - len(keys) > 0 | 
| 182 // - all keys are Valid, !Incomplete, and in the current namespace | 182 // - all keys are Valid, !Incomplete, and in the current namespace | 
| 183 // - none keys of the keys are 'special' (use a kind prefixed with '__ ') | 183 // - none keys of the keys are 'special' (use a kind prefixed with '__ ') | 
| 184 // - cb is not nil | 184 // - cb is not nil | 
| 185 DeleteMulti(keys []*Key, cb DeleteMultiCB) error | 185 DeleteMulti(keys []*Key, cb DeleteMultiCB) error | 
| 186 | 186 | 
| 187 » // Testable returns the Testable interface for the implementation, or ni l if | 187 » // WithoutTransaction returns a derived Context without a transaction ap plied. | 
| 
iannucci
2016/09/16 07:39:43
Note that it's safe to call this even when the con
 
dnj
2016/09/16 16:09:21
Done. I also made the user-facing implementation o
 | |
| 188 » // there is none. | 188 » WithoutTransaction() context.Context | 
| 189 » Testable() Testable | 189 | 
| 190 » // CurrentTransaction returns a reference to the current Transaction, or nil | |
| 191 » // if the Context does not have a current Transaction. | |
| 192 » CurrentTransaction() Transaction | |
| 193 | |
| 194 » // GetTestable returns the Testable interface for the implementation, or nil | |
| 195 » // if there is none. | |
| 196 » GetTestable() Testable | |
| 190 } | 197 } | 
| OLD | NEW |