Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.

Basic PoC/test code for using Google Cloud Platform PubSub from Go

Notifications You must be signed in to change notification settings

0xdevalias/poc-gcloud-pubsub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poc-gcloud-pubsub

Basic PoC/test code for using Google Cloud Platform PubSub from Go.

Setup

You will need to create a topic and a subscription on that topic for the subscriber to use.

# Setup environment variables
source ./auth.sh

# Get go dependencies
dep ensure

# Create a topic
gcloud beta pubsub topics create my-test-topic --project testpubsubstuff

# Create a subscription
gcloud beta pubsub subscriptions create foo-subscription --topic my-test-topic --project testpubsubstuff

# List topics
gcloud beta pubsub topics list --project testpubsubstuff

# List subscriptions
gcloud beta pubsub subscriptions list --project testpubsubstuff

Usage

# Setup environment variables
source ./auth.sh

# Run
go run subscriber.go
go run publisher.go

Cleanup

# Setup environment variables
source ./auth.sh

# Remove subscription
gcloud beta pubsub subscriptions delete foo-subscription --project testpubsubstuff

# Remove topic
gcloud beta pubsub topics delete my-test-topic --project testpubsubstuff

Misc

About

Basic PoC/test code for using Google Cloud Platform PubSub from Go

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published