OLD | NEW |
(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 example is an example Google Cloud Endpoints service, which is |
| 6 // compatible with the automatic client generation code in infra/gae/epclient. |
| 7 // |
| 8 // It implements a really dumb named persistant counter. |
| 9 package example |
| 10 |
| 11 import ( |
| 12 "infra/gae/libs/ephelper" |
| 13 |
| 14 "github.com/GoogleCloudPlatform/go-endpoints/endpoints" |
| 15 ) |
| 16 |
| 17 // Example is the example service type. |
| 18 type Example struct{} |
| 19 |
| 20 var mi = ephelper.MethodInfoMap{} |
| 21 |
| 22 var si = &endpoints.ServiceInfo{ |
| 23 Name: "dumb_counter", |
| 24 Version: "v1", |
| 25 Description: "A hideously stupid persistant counter service.", |
| 26 } |
| 27 |
| 28 // RegisterEndpointsService allows appengine apps (and epclient's `go generate` |
| 29 // functionality) to register this stupid dumb_counter service. |
| 30 func RegisterEndpointsService(s *endpoints.Server) error { |
| 31 return ephelper.Register(s, Example{}, si, mi) |
| 32 } |
OLD | NEW |