Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kelseyhightower committed Apr 10, 2017
1 parent f0d53ca commit 368c9b2
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions examples/topic/README.md
@@ -1,24 +1,27 @@
# Event Function
# Google Cloud Functions Go: Topic Example

## Usage

Build the plugin:
Build the Go plugin:

```
go build -buildmode=plugin -o function.so main.go
go build -buildmode=plugin -o functions.so main.go
```

Create the Google Cloud Function source package:
Test the function:

```
google-cloud-functions-go --package \
--entry-point F \
--event-type event \
--plugin-path function.so
cat event.json | cloud-functions-go-shim -entry-point F -event-type topic -plugin-path functions.so
```

Create the Cloud Function zip archive:

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

```
wrote F-event-1491763297.zip
wrote F-topic-1491763297.zip
```

Use the Cloud Function UI to deploy the fuction from a zip file.
Use the Cloud Functions UI to deploy the fuction from a ZIP upload, set the fuction to execute to `F`, and the trigger to `Cloud Pub/Sub topic`

0 comments on commit 368c9b2

Please sign in to comment.