| 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 prod | 5 package prod |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "net/http" | 8 "net/http" |
| 9 | 9 |
| 10 "github.com/luci/gae/service/info" | 10 "github.com/luci/gae/service/info" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 // Use adds production implementations for all the gae services to the | 40 // Use adds production implementations for all the gae services to the |
| 41 // context. | 41 // context. |
| 42 // | 42 // |
| 43 // The services added are: | 43 // The services added are: |
| 44 // - github.com/luci/gae/service/datastore | 44 // - github.com/luci/gae/service/datastore |
| 45 // - github.com/luci/gae/service/taskqueue | 45 // - github.com/luci/gae/service/taskqueue |
| 46 // - github.com/luci/gae/service/memcache | 46 // - github.com/luci/gae/service/memcache |
| 47 // - github.com/luci/gae/service/info | 47 // - github.com/luci/gae/service/info |
| 48 // - github.com/luci/gae/service/urlfetch | 48 // - github.com/luci/gae/service/urlfetch |
| 49 // - github.com/luci/gae/service/user |
| 50 // - github.com/luci-go/common/logging |
| 49 // | 51 // |
| 50 // These can be retrieved with the <service>.Get functions. | 52 // These can be retrieved with the <service>.Get functions. |
| 51 // | 53 // |
| 52 // The implementations are all backed by the real appengine SDK functionality, | 54 // The implementations are all backed by the real appengine SDK functionality, |
| 53 func Use(c context.Context, r *http.Request) context.Context { | 55 func Use(c context.Context, r *http.Request) context.Context { |
| 54 aeCtx := appengine.NewContext(r) | 56 aeCtx := appengine.NewContext(r) |
| 55 c = context.WithValue(c, prodContextKey, aeCtx) | 57 c = context.WithValue(c, prodContextKey, aeCtx) |
| 56 c = context.WithValue(c, prodContextNoTxnKey, aeCtx) | 58 c = context.WithValue(c, prodContextNoTxnKey, aeCtx) |
| 57 » return useUser(useURLFetch(useRDS(useMC(useTQ(useGI(c)))))) | 59 » return useUser(useURLFetch(useRDS(useMC(useTQ(useGI(useLogging(c))))))) |
| 58 } | 60 } |
| OLD | NEW |