Golang:不同的AppEngine包

huangapple go评论78阅读模式
英文:

Golang: Different AppEngine packages

问题

这两个AppEngine包之间有什么区别呢?

https://cloud.google.com/appengine/docs/go/reference 这个是Google Cloud官方提供的AppEngine Go语言包的文档。

https://godoc.org/google.golang.org/appengine 这个是Google官方提供的AppEngine Go语言包的另一个文档。

唯一引起我注意的是第二个文档中没有Context类型。

在开发应用程序时,应该使用哪个包呢?

英文:

What is the difference between this two AppEngine packages:
https://cloud.google.com/appengine/docs/go/reference
https://godoc.org/google.golang.org/appengine

The only thing that stands out for me is that 2nd one has no Context type

Which one should someone use in developing an application?

答案1

得分: 3

"google.golang.org/appengine"包可以在托管的虚拟机(managed VMs)和App Engine Classic上使用。"appengine"包只能在App Engine Classic上使用。

"google.golang.org/appengine"包使用x/net/context包来传递上下文。"appengine"包使用与这些包特定的上下文。

请参阅https://github.com/golang/appengine#3-update-code-using-deprecated-removed-or-modified-apis,了解API中的差异列表。

英文:

The "google.golang.org/appengine" packages work on both managed VMs and App Engine Classic. The "appengine" packages work on App Engine Classic only.

The "google.golang.org/appengine" packages use the x/net/context package for passing context around. The "appengine" packages use a context specific to those packages.

See https://github.com/golang/appengine#3-update-code-using-deprecated-removed-or-modified-apis for a list of differences in the APIs.

huangapple
  • 本文由 发表于 2015年4月7日 02:45:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/29477505.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定