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

Unified Diff: appengine/apigen_examples/dumb_counter/dumbCounter/service_currentvalue.go

Issue 1750143003: Remove ephelper and other endpoints code. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: appengine/apigen_examples/dumb_counter/dumbCounter/service_currentvalue.go
diff --git a/appengine/apigen_examples/dumb_counter/dumbCounter/service_currentvalue.go b/appengine/apigen_examples/dumb_counter/dumbCounter/service_currentvalue.go
deleted file mode 100644
index c03d942e6dde63216c2cae67193a087548804be2..0000000000000000000000000000000000000000
--- a/appengine/apigen_examples/dumb_counter/dumbCounter/service_currentvalue.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package dumbCounter
-
-import (
- "github.com/GoogleCloudPlatform/go-endpoints/endpoints"
- dstore "github.com/luci/gae/service/datastore"
- "golang.org/x/net/context"
-)
-
-// CurrentValueReq describes the inputs to the CurrentValueReq RPC.
-type CurrentValueReq struct {
- Name string `endpoints:"required"`
-}
-
-// CurrentValueRsp describes the outputs of the CurrentValueReq RPC.
-type CurrentValueRsp struct {
- Val int64 `json:",string"`
-}
-
-// CurrentValue gets the current value of a counter (duh)
-func (e *Example) CurrentValue(c context.Context, r *CurrentValueReq) (rsp *CurrentValueRsp, err error) {
- c, err = e.Use(c, currentValueMethodInfo)
- if err != nil {
- return
- }
-
- ds := dstore.Get(c)
-
- ctr := &Counter{Name: r.Name}
- if err = ds.Get(ctr); err != nil {
- return
- }
-
- rsp = &CurrentValueRsp{ctr.Val}
- return
-}
-
-var currentValueMethodInfo = &endpoints.MethodInfo{
- Path: "counter/{Name}",
- Desc: "Returns the current value held by the named counter",
-}

Powered by Google App Engine
This is Rietveld 408576698