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

Side by Side Diff: appengine/apigen_examples/dumb_counter/dumbCounter/service_list.go

Issue 1750143003: Remove ephelper and other endpoints code. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Created 4 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 package dumbCounter
6
7 import (
8 "github.com/GoogleCloudPlatform/go-endpoints/endpoints"
9 dstore "github.com/luci/gae/service/datastore"
10 "golang.org/x/net/context"
11 )
12
13 // ListRsp is the response from the 'List' RPC. It contains a list of Counters
14 // including their IDs and Values.
15 type ListRsp struct {
16 Counters []Counter
17 }
18
19 // List returns a list of all the counters. Note that it's very poorly
20 // implemented! It's completely unpaged. I don't care :).
21 func (e *Example) List(c context.Context) (rsp *ListRsp, err error) {
22 c, err = e.Use(c, listMethodInfo)
23 if err != nil {
24 return
25 }
26
27 ds := dstore.Get(c)
28 rsp = &ListRsp{}
29 err = ds.GetAll(dstore.NewQuery("Counter"), &rsp.Counters)
30 return
31 }
32
33 var listMethodInfo = &endpoints.MethodInfo{
34 Path: "counter",
35 Desc: "Returns all of the available counters",
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698