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 memory | 5 package memory |
6 | 6 |
7 import ( | 7 import ( |
8 "errors" | 8 "errors" |
9 "fmt" | 9 "fmt" |
10 | 10 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 212 |
213 func (d *txnDsImpl) Count(fq *ds.FinalizedQuery) (ret int64, err error) { | 213 func (d *txnDsImpl) Count(fq *ds.FinalizedQuery) (ret int64, err error) { |
214 return countQuery(fq, d.kc, true, d.data.snap, d.data.snap) | 214 return countQuery(fq, d.kc, true, d.data.snap, d.data.snap) |
215 } | 215 } |
216 | 216 |
217 func (*txnDsImpl) RunInTransaction(func(c context.Context) error, *ds.Transactio
nOptions) error { | 217 func (*txnDsImpl) RunInTransaction(func(c context.Context) error, *ds.Transactio
nOptions) error { |
218 return errors.New("datastore: nested transactions are not supported") | 218 return errors.New("datastore: nested transactions are not supported") |
219 } | 219 } |
220 | 220 |
221 func (d *txnDsImpl) WithoutTransaction() context.Context { | 221 func (d *txnDsImpl) WithoutTransaction() context.Context { |
222 » return context.WithValue(d, currentTxnKey, nil) | 222 » return context.WithValue(d, ¤tTxnKey, nil) |
223 } | 223 } |
224 | 224 |
225 func (d *txnDsImpl) CurrentTransaction() ds.Transaction { | 225 func (d *txnDsImpl) CurrentTransaction() ds.Transaction { |
226 return d.data.txn | 226 return d.data.txn |
227 } | 227 } |
228 | 228 |
229 func (d *txnDsImpl) GetTestable() ds.Testable { return nil } | 229 func (d *txnDsImpl) GetTestable() ds.Testable { return nil } |
OLD | NEW |