Skip to content
Cloud Pub/Sub sample
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/publisher
gae
.editorconfig
.gcloudignore
.gitignore
LICENSE
README.md
go.mod
go.sum

README.md

pubsub-sample

Cloud Pub/Sub sample

Requirements

  • Go 1.11 or later
  • Google Cloud Platform account

How to run

Publish a message

$ export GOOGLE_CLOUD_PROJECT=<your project name>
$ export GO111MODULE=on
$ go run cmd/publisher/publisher.go <topic> <message>

Example:

$ go run cmd/publisher/publisher.go first-topic "Hello world"

Subscribe a topic

With GAE

$ cd gae
$ gcloud app deploy
You can’t perform that action at this time.