Joh*_*ger 6 google-cloud-platform google-cloud-functions serverless
GCP / Cloud Functions 是否有类似于 AWS Lambda Layers 的库概念?这意味着,如果我们想减少代码重复并为 Google Cloud Functions 推出通用库层,我们会怎么做?
不,云函数没有这种功能。我心中有 3 个直接选择
项目树
root
|
- Common
|
- Functions
|
- function A
|
- function B
Run Code Online (Sandbox Code Playgroud)
在函数 A 和函数 B 中,您使用 Common 目录中的公共文件。当您部署函数时,在目录中进行root,并使用源目录来指示在哪个目录中查找要部署的函数
gcloud functions deploy --source=function/functionA ...
Run Code Online (Sandbox Code Playgroud)
权衡
| 归档时间: |
|
| 查看次数: |
2360 次 |
| 最近记录: |