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 » "google.golang.org/cloud/datastore" | 8 » "cloud.google.com/go/datastore" |
9 | 9 |
10 "golang.org/x/net/context" | 10 "golang.org/x/net/context" |
11 ) | 11 ) |
12 | 12 |
13 // Use installs the cloud services implementation into the supplied Context. | 13 // Use installs the cloud services implementation into the supplied Context. |
14 // | 14 // |
15 // This includes: | 15 // This includes: |
16 // - github.com/luci/gae/service/info | 16 // - github.com/luci/gae/service/info |
17 // - github.com/luci/gae/service/datastore | 17 // - github.com/luci/gae/service/datastore |
18 // | 18 // |
19 // This is built around the ability to use cloud datastore. | 19 // This is built around the ability to use cloud datastore. |
20 func Use(c context.Context, client *datastore.Client) context.Context { | 20 func Use(c context.Context, client *datastore.Client) context.Context { |
21 return UseDS(useInfo(c), client) | 21 return UseDS(useInfo(c), client) |
22 } | 22 } |
23 | 23 |
24 // UseDS installs the cloud datastore implementation into the supplied Context. | 24 // UseDS installs the cloud datastore implementation into the supplied Context. |
25 func UseDS(c context.Context, client *datastore.Client) context.Context { | 25 func UseDS(c context.Context, client *datastore.Client) context.Context { |
26 cds := cloudDatastore{ | 26 cds := cloudDatastore{ |
27 client: client, | 27 client: client, |
28 } | 28 } |
29 return cds.use(c) | 29 return cds.use(c) |
30 } | 30 } |
OLD | NEW |