| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. | 1 // Copyright 2016 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 cloud | 5 package cloud |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "fmt" | 8 "fmt" |
| 9 "reflect" | 9 "reflect" |
| 10 "strings" | 10 "strings" |
| 11 "time" | 11 "time" |
| 12 | 12 |
| 13 "github.com/luci/luci-go/common/errors" | 13 "github.com/luci/luci-go/common/errors" |
| 14 | 14 |
| 15 "cloud.google.com/go/datastore" |
| 15 ds "github.com/luci/gae/service/datastore" | 16 ds "github.com/luci/gae/service/datastore" |
| 16 infoS "github.com/luci/gae/service/info" | 17 infoS "github.com/luci/gae/service/info" |
| 17 "google.golang.org/cloud/datastore" | |
| 18 | 18 |
| 19 "golang.org/x/net/context" | 19 "golang.org/x/net/context" |
| 20 ) | 20 ) |
| 21 | 21 |
| 22 type cloudDatastore struct { | 22 type cloudDatastore struct { |
| 23 client *datastore.Client | 23 client *datastore.Client |
| 24 } | 24 } |
| 25 | 25 |
| 26 func (cds *cloudDatastore) use(c context.Context) context.Context { | 26 func (cds *cloudDatastore) use(c context.Context) context.Context { |
| 27 return ds.SetRawFactory(c, func(ic context.Context, wantTxn bool) ds.Raw
Interface { | 27 return ds.SetRawFactory(c, func(ic context.Context, wantTxn bool) ds.Raw
Interface { |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 case datastore.ErrNoSuchEntity: | 523 case datastore.ErrNoSuchEntity: |
| 524 return ds.ErrNoSuchEntity | 524 return ds.ErrNoSuchEntity |
| 525 case datastore.ErrConcurrentTransaction: | 525 case datastore.ErrConcurrentTransaction: |
| 526 return ds.ErrConcurrentTransaction | 526 return ds.ErrConcurrentTransaction |
| 527 case datastore.ErrInvalidKey: | 527 case datastore.ErrInvalidKey: |
| 528 return ds.ErrInvalidKey | 528 return ds.ErrInvalidKey |
| 529 default: | 529 default: |
| 530 return err | 530 return err |
| 531 } | 531 } |
| 532 } | 532 } |
| OLD | NEW |