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

Side by Side Diff: go/src/infra/gae/epservice/example/service_list.go

Issue 1240573002: Reland: Refactor current GAE abstraction library to be free of the SDK* (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: expand coverage range to fit 32bit test expectations Created 5 years, 5 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
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 example 5 package example
6 6
7 import ( 7 import (
8 "golang.org/x/net/context" 8 "golang.org/x/net/context"
9 » "infra/gae/libs/wrapper" 9 » "infra/gae/libs/gae"
10 » "infra/gae/libs/wrapper/gae" 10 » "infra/gae/libs/gae/prod"
11 11
12 "github.com/GoogleCloudPlatform/go-endpoints/endpoints" 12 "github.com/GoogleCloudPlatform/go-endpoints/endpoints"
13 ) 13 )
14 14
15 // ListRsp is the response from the 'List' RPC. It contains a list of Counters 15 // ListRsp is the response from the 'List' RPC. It contains a list of Counters
16 // including their IDs and Values. 16 // including their IDs and Values.
17 type ListRsp struct { 17 type ListRsp struct {
18 Counters []Counter 18 Counters []Counter
19 } 19 }
20 20
21 // List returns a list of all the counters. Note that it's very poorly 21 // List returns a list of all the counters. Note that it's very poorly
22 // implemented! It's completely unpaged. I don't care :). 22 // implemented! It's completely unpaged. I don't care :).
23 func (Example) List(c endpoints.Context) (rsp *ListRsp, err error) { 23 func (Example) List(c context.Context) (rsp *ListRsp, err error) {
24 » ds := wrapper.GetDS(gae.Use(context.Background(), c)) 24 » rds := gae.GetRDS(prod.Use(c))
25 rsp = &ListRsp{} 25 rsp = &ListRsp{}
26 » _, err = ds.GetAll(ds.NewQuery("Counter"), &rsp.Counters) 26 » _, err = rds.GetAll(rds.NewQuery("Counter"), &rsp.Counters)
27 if err != nil { 27 if err != nil {
28 return 28 return
29 } 29 }
30 return 30 return
31 } 31 }
32 32
33 func init() { 33 func init() {
34 mi["List"] = &endpoints.MethodInfo{ 34 mi["List"] = &endpoints.MethodInfo{
35 Path: "counter", 35 Path: "counter",
36 Desc: "Returns all of the available counters", 36 Desc: "Returns all of the available counters",
37 } 37 }
38 } 38 }
OLDNEW
« no previous file with comments | « go/src/infra/gae/epservice/example/service_currentvalue.go ('k') | go/src/infra/gae/libs/gae/brokenfeatures.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698