百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

google-cloud-functions-go

> 编程语言
开源

Google Cloud 函数教程和技巧,可启用 Go 的使用。

183 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Google Cloud 函数教程和技巧,可启用 Go 的使用。

Google Cloud Functions Go

This project contains a collection of tutorials and hacks for using Go with Google Cloud Functions.

Disclaimer

This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.

How it Works

Google Cloud Functions only supports node.js so shims must be used to wrap calls to Go code. The cloud-functions-go-shim binary bridges node.js and Go functions. Each Go function to be executed must be exported from a Go plugin.

The use of Go plugins limit the runtime environment to Linux.

Install

Download the cloud-functions-go and cloud-functions-go-shim binaries and put them in your path.

Usage

Build

Create a Go plugin holding the function to be executed:

go build -buildmode=plugin -o functions.so examples/topic/main.go

Test

Use the cloud-functions-go-shim to test your function:

bash
cat examples/topic/event.json | \
  cloud-functions-go-shim -entry-point F -event-type topic -plugin-path functions.so 

Testing only works on Linux; a current limitation of Go plugins.

Package

The cloud-functions-go command is used to package your function along with the necessary shims for execution in the Cloud Functions environment.

cloud-functions-go -entry-point F -event-type topic -plugin-path functions.so

Output

wrote F-topic-1491796383.zip

The zip archive containes the following files:

  • index.js - node.js shim that calls out to the cloud-functions-go-shim binary
  • functions.so - the Go function to be executed
  • cloud-functions-go-shim - the shim between node.js and Go

Deploy

Upload the zip archive and set the function to F and the trigger to topic.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Go

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言