可以使用Go Google App Engine Standard进行Cloud Endpoints吗?

可以使用Go Google App Engine Standard进行Cloud Endpoints吗?

问题描述:

I have implemented a simple API in Go on Google App Engine Standard using just:

func init() {
    http.HandleFunc("/api/v1/resource",submitResource)
}

Nothing special. However I want to port this code to using Cloud Endpoints instead in order to get the better monitoring and diagnostics.

Is it even possible with STANDARD instances or must I move to FLEXIBLE?

I can't find any documentation on this. Nor answers to this seemingly simple question. At the moment I half wish I had chosen Python because its support seems more mature. I chose Go because it seems more appropriate for API-like code because my minimal research suggested Go offered better performance.

If it is possible, are there any pointers to how please?

我已经使用以下方法在Google App Engine标准的Go中实现了一个简单的API: p>

  func init(){
 http.HandleFunc(“ / api / v1 / resource”,submitResource)
} 
  code>  pre> 
 
 

没什么特别的 。 但是我想将此代码移植到使用Cloud Endpoints上,以便获得更好的监视和诊断。 p>

使用STANDARD实例是否有可能,还是我必须迁移到FLEXIBLE? p >

我找不到与此相关的任何文档。 这个看似简单的问题也没有答案。 目前,我一半希望我选择Python,因为它的支持似乎更加成熟。 我之所以选择Go,是因为它看起来更适合于类似API的代码,因为我的最少研究表明Go可以提供更好的性能。 p>

如果可能的话,是否有任何提示如何实现的? p > div>

After much research and trial and error, the simple answer is "No." - as of Dec 2016.

The longer answer is it's possible if you want to put far too much effort into making up to date libraries of your own. There is basically no support, even in alpha, for the current Google Cloud Endpoints using Go with Google App Engine Standard.

Only Python and Java are supported on GAE Standard via the Endpoints Frameworks. However, Go is supported on GAE Flexible.

Here is the Go GAE Flexible sample: https://github.com/GoogleCloudPlatform/golang-samples/tree/master/endpoints/getting-started

It's possible to run Go+endpoints on GAE Standard environment, however libraries might be outdated now.
Libraries and sample app can be found on github:
https://github.com/GoogleCloudPlatform/go-endpoints
I have successfully deployed "Greetings" as AppEngine SE app, and it works.