【发布时间】:2018-12-06 10:09:02
【问题描述】:
我正在尝试在 Google Cloud Platform 上托管一个 Go 应用程序,我需要它来执行一些文件写入。 GCP 不允许您直接在 App Engine 中进行文件写入,但需要您使用存储桶。
从他们的文档中,您可以像这样访问 PHP 中的存储桶
$default_bucket = CloudStorageTools::getDefaultGoogleStorageBucketName();
$fp = fopen("gs://${default_bucket}/hello_default_stream.txt", 'w');
fwrite($fp, $newFileContent);
fclose($fp);
有没有对应的 Golang 语言?
【问题讨论】:
-
您说的是 App Engine Standard 还是 Flex?
标签: go google-cloud-platform google-cloud-storage