AppEngine-Go模块是否需要共享相同的代码库?

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

Do AppEngine-Go modules have to share the same code base

问题

给出的appengine-go模块上传的典型示例暗示了同一应用程序中的所有模块必须共享相同的代码库。

例如:appcfg update app.yaml mobile-frontend.yaml my-module.yaml

在这种情况下,应用程序根目录中的所有Go文件对每个模块都进行相同的处理(因此共享相同的代码)。

是否有办法为每个模块指定单独的根目录,例如作为默认应用程序根目录的子目录?

谢谢。

英文:

The canonical example given for appengine-go module uploads implies that all modules within a given app must share the same codebase.

e.g. appcfg update app.yaml mobile-frontend.yaml my-module.yaml

In this case, all Go files in the app root directory are processed identically for each module (and therefore share the same code).

Is there any way to specify a separate root directory for each module e.g. as a sub-directory of the default app root?

TIA

答案1

得分: 2

作为一个新的 Stack Overflow 用户,我受到了回答自己问题的8小时限制。因此,我最初将问题作为评论发布了出来。

所以,这是有关这个问题的链接,供遇到同样问题的人使用:

https://groups.google.com/d/msg/google-appengine-go/T90jtkZ83s4/MizIcnjH4QIJ

另外,新的模块化范式对于 GAE 项目来说非常重要。它不仅允许每个模块有不同的代码库,还可以使用不同的运行时环境!!!

这意味着,至少在理论上,你可以在同一个应用程序中利用每种语言的最佳特性。很棒!

英文:

As a new SO user, I was restricted by the 8-hour limit for answering my own question. Therefore I posted it initially as a comment.

So here is the link in question for anyone who runs into this problem:

https://groups.google.com/d/msg/google-appengine-go/T90jtkZ83s4/MizIcnjH4QIJ

As an aside, the new modules paradigm is vital for GAE projects. Not only does it allow for different code bases for each module but also different runtimes!!!

This means that, theoretically at least, you can leverage the best features of each language within the same app. Nice!

答案2

得分: 2

终于在开发环境和App Engine上成功运行了我的应用程序。谢谢。总结一下线程

我的应用程序目录结构如下:

$ ls *
README.md	dispatch.yaml

frontend:
app.yaml	index.html	server.go

images:
images.yaml	server.go

然后在开发环境中运行:

$ goapp serve dispatch.yaml */*.yaml

并部署:

$ appcfg.py update_dispatch .
$ goapp deploy */*.yaml

源代码。

英文:

Finally got my app working in development and on App Engine. Thanks. To summarize the thread:

My app directory looks like this:

$ ls *
README.md	dispatch.yaml

frontend:
app.yaml	index.html	server.go

images:
images.yaml	server.go

Then to run in development:

$ goapp serve dispatch.yaml */*.yaml

and to deploy:

$ appcfg.py update_dispatch .
$ goapp deploy */*.yaml

Source code.

huangapple
  • 本文由 发表于 2014年2月11日 21:39:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/21703473.html
匿名

发表评论

匿名网友

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

确定