Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: impl/prod/context.go

Issue 1259593005: Add 'user friendly' datastore API. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: more docs Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « impl/memory/raw_datastore_test.go ('k') | impl/prod/raw_datastore.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "golang.org/x/net/context" 10 "golang.org/x/net/context"
11 "google.golang.org/appengine" 11 "google.golang.org/appengine"
12 ) 12 )
13 13
14 // Use adds production implementations for all the gae services to the context, 14 // Use adds production implementations for all the gae services to the context,
15 // using the existing context obtained by appengine.NewContext. 15 // using the existing context obtained by appengine.NewContext.
16 // 16 //
17 // The services added are: 17 // The services added are:
18 // - github.com/luci/gae/service/rawdatastore 18 // - github.com/luci/gae/service/datastore
19 // - github.com/luci/gae/service/taskqueue 19 // - github.com/luci/gae/service/taskqueue
20 // - github.com/luci/gae/service/memcache 20 // - github.com/luci/gae/service/memcache
21 // - github.com/luci/gae/service/info 21 // - github.com/luci/gae/service/info
22 // 22 //
23 // These can be retrieved with the <service>.Get functions. 23 // These can be retrieved with the <service>.Get functions.
24 // 24 //
25 // The implementations are all backed by the real appengine SDK functionality, 25 // The implementations are all backed by the real appengine SDK functionality,
26 func Use(c context.Context) context.Context { 26 func Use(c context.Context) context.Context {
27 return useRDS(useMC(useTQ(useGI(c)))) 27 return useRDS(useMC(useTQ(useGI(c))))
28 } 28 }
29 29
30 // Use adds production implementations for all the gae services to the context. 30 // Use adds production implementations for all the gae services to the context.
31 // 31 //
32 // The services added are: 32 // The services added are:
33 // - github.com/luci/gae/service/rawdatastore 33 // - github.com/luci/gae/service/datastore
34 // - github.com/luci/gae/service/taskqueue 34 // - github.com/luci/gae/service/taskqueue
35 // - github.com/luci/gae/service/memcache 35 // - github.com/luci/gae/service/memcache
36 // - github.com/luci/gae/service/info 36 // - github.com/luci/gae/service/info
37 // 37 //
38 // These can be retrieved with the <service>.Get functions. 38 // These can be retrieved with the <service>.Get functions.
39 // 39 //
40 // The implementations are all backed by the real appengine SDK functionality, 40 // The implementations are all backed by the real appengine SDK functionality,
41 func UseRequest(r *http.Request) context.Context { 41 func UseRequest(r *http.Request) context.Context {
42 return useRDS(useMC(useTQ(useGI(appengine.NewContext(r))))) 42 return useRDS(useMC(useTQ(useGI(appengine.NewContext(r)))))
43 } 43 }
OLDNEW
« no previous file with comments | « impl/memory/raw_datastore_test.go ('k') | impl/prod/raw_datastore.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698