Sample apps and code written for Google Cloud in the Go programming language.
Clone or download
Permalink
Failed to load latest commit information.
appengine appengine/go111/cloudsql: initial commit of updated sample (#620) Sep 21, 2018
appengine_flexible all: use stdlib context package (#601) Sep 6, 2018
auth all: use stdlib context package (#601) Sep 6, 2018
bigquery bigquery: add load-based schema widening example (#609) Sep 13, 2018
bigtable all: use stdlib context package (#601) Sep 6, 2018
cdn/signedurls cdn: Add URL signing example (#386) Mar 2, 2018
container/listclusters all: use stdlib context package (#601) Sep 6, 2018
container_registry/container_analysis/src/sample container_registry: retry PubSub test (#605) Sep 10, 2018
datastore all: use stdlib context package (#601) Sep 6, 2018
dialogflow all: use stdlib context package (#601) Sep 6, 2018
dlp all: use stdlib context package (#601) Sep 6, 2018
docs docs/appengine: add taskqueue host sample (#619) Sep 19, 2018
endpoints all: use stdlib context package (#601) Sep 6, 2018
errorreporting/errorreporting_quickstart all: use stdlib context package (#601) Sep 6, 2018
firestore all: use stdlib context package (#601) Sep 6, 2018
getting-started getting-started/devflowapp: fix broken link, bad Dockerfile command, … Sep 10, 2018
internal all: use stdlib context package (#601) Sep 6, 2018
iot/manager all: use stdlib context package (#601) Sep 6, 2018
iotkit/helloworld iotkit/helloworld: add instructions to build, deploy and run Nov 2, 2016
jobs jobs: enable quickstart test (#611) Sep 19, 2018
kms all: use stdlib context package (#601) Sep 6, 2018
language all: use stdlib context package (#601) Sep 6, 2018
logging all: use stdlib context package (#601) Sep 6, 2018
memorystore/redis memorystore: use bucket name instead of GCS path (#594) Sep 4, 2018
monitoring monitoring: add deleteMetric sample (#616) Sep 19, 2018
opencensus/opencensus_spanner_quickstart all: use stdlib context package (#601) Sep 6, 2018
profiler profiler: do not collect allocation profiles in profiler quickstart (#… Sep 17, 2018
pubsub all: use stdlib context package (#601) Sep 6, 2018
spanner all: use stdlib context package (#601) Sep 6, 2018
speech speech: add auto punctuation and enhanced model snippets (#614) Sep 19, 2018
storage all: use stdlib context package (#601) Sep 6, 2018
tasks/pull_queue all: use stdlib context package (#601) Sep 6, 2018
testing testing: use final version of Go 1.11 (#610) Sep 14, 2018
texttospeech all: use stdlib context package (#601) Sep 6, 2018
trace/trace_quickstart trace, opencensus: import Stackdriver exporter from the new path Apr 25, 2018
translate all: use stdlib context package (#601) Sep 6, 2018
videointelligence all: use stdlib context package (#601) Sep 6, 2018
vision all: use stdlib context package (#601) Sep 6, 2018
CONTRIBUTING.md contributing: clean up testing instructions Apr 2, 2018
LICENSE Initial commit. Sep 28, 2015
README.md tasks: add tasks pull_queue sample snippets (#550) Aug 8, 2018
key.json.enc travis: don't print env from script, rotate key Apr 27, 2016
license_test.go endpoints: add gRPC getting started sample (#217) Apr 3, 2017
nothing.go Add test for license headers Apr 4, 2016
regiontag_test.go testing: add test for spurious region tags in go docs (#543) Aug 17, 2018

README.md

Google Cloud Platform Go Samples

Kokoro Build Status

This repository holds sample code written in Go that demonstrates the Google Cloud Platform.

Some samples have accompanying guides on cloud.google.com. See respective README files for details.

Contributing changes.

Entirely new samples are not accepted. Bug fixes are welcome, either as pull requests or as GitHub issues.

See CONTRIBUTING.md for details on how to contribute.

Licensing

Code in this repository is licensed under the Apache 2.0. See LICENSE.

Index

Note: samples under docs/appengine are not shown because they mostly do not run, they are just code snippets.

Getting Started

Path Description
getting-started/bookshelf Package bookshelf contains the bookshelf database and app configuration, shared by the main app module and the worker module.
getting-started/bookshelf/app Sample bookshelf is a fully-featured app demonstrating several Google Cloud APIs, including Datastore, Cloud SQL, Cloud Storage.
getting-started/bookshelf/pubsub_worker Sample pubsub_worker demonstrates the use of the Cloud Pub/Sub API to communicate between two modules.
getting-started/helloworld Sample helloworld is a basic App Engine flexible app.

Logging and Monitoring (Stackdriver)

Path Description
docs/error-reporting/fluent Sample fluent demonstrates integration of fluent and Cloud Error reporting.
docs/sql/listinstances Sample listinstances lists the Cloud SQL instances for a given project ID.
docs/storage/listbuckets Command listbuckets lists the Google Cloud buckets for a given project ID.
logging/simplelog Sample simplelog writes some entries, lists them, then deletes the log.
monitoring/custommetric Command custommetric creates a custom metric and writes TimeSeries value to it.
monitoring/listresources Command listresources lists the Google Cloud Monitoring v3 Environment against an authenticated user.

Compute

Path Description
appengine/bigquery This App Engine application uses its default service account to list all the BigQuery datasets accessible via the BigQuery REST API.
appengine_flexible/analytics Sample analytics demonstrates Google Analytics calls from App Engine flexible environment.
appengine_flexible/cloudsql Sample cloudsql demonstrates usage of Cloud SQL for MySQL from App Engine flexible environment.
appengine_flexible/cloudsql_postgres Sample cloudsql_postgres demonstrates usage of Cloud SQL for PostgreSQL from App Engine flexible environment.
appengine_flexible/datastore Sample datastore demonstrates use of the cloud.google.com/go/datastore package from App Engine flexible.
appengine_flexible/endpoints Sample endpoints demonstrates a Cloud Endpoints API.
appengine_flexible/endpoints/client Command client performs authenticated requests against an Endpoints API server.
appengine_flexible/helloworld Sample helloworld is a basic App Engine flexible app.
appengine_flexible/mailgun Sample mailgun is a demonstration on sending an e-mail from App Engine flexible environment.
appengine_flexible/mailjet Sample mailjet is a demonstration on sending an e-mail from App Engine flexible environment.
appengine_flexible/memcache Sample memcache demonstrates use of a memcached client from App Engine flexible environment.
appengine_flexible/pubsub Sample pubsub demonstrates use of the cloud.google.com/go/pubsub package from App Engine flexible environment.
appengine_flexible/sendgrid Sample sendgrid is a demonstration on sending an e-mail from App Engine flexible environment.
appengine_flexible/static_files Package static demonstrates a static file handler for App Engine flexible environment.
appengine_flexible/storage Sample storage demonstrates use of the cloud.google.com/go/storage package from App Engine flexible environment.
appengine_flexible/tiny Sample tiny demonstrates overall program structure: a main package with a main function that calls appengine.Main.
appengine_flexible/twilio Sample twilio demonstrates sending and receiving SMS, receiving calls via Twilio from App Engine flexible environment.
tasks/pull_queue Sample Pull Queue snippets to create, lease, and acknowledge Cloud Tasks.

Storage

Path Description
datastore/tasks A simple command-line task list manager to demonstrate using the cloud.google.com/go/datastore package.
storage/buckets Sample buckets creates a bucket, lists buckets and deletes a bucket using the Google Storage API.

Big Data

Path Description
bigquery/syncquery Command syncquery queries a Google BigQuery dataset.
pubsub/subscriptions Command subscriptions is a tool to manage Google Cloud Pub/Sub subscriptions by using the Pub/Sub API.
pubsub/topics Command topics is a tool to manage Google Cloud Pub/Sub topics by using the Pub/Sub API.

Machine Learning

Path Description
language/analyze Command analyze performs sentiment, entity, and syntax analysis on a string of text via the Cloud Natural Language API.
speech/caption Command caption reads an audio file and outputs the transcript for it.
speech/captionasync Command captionasync reads an audio file and outputs the transcript for it.
speech/livecaption Command livecaption pipes the stdin audio data to Google Speech API and outputs the transcript.
speech/wordoffset Command wordoffset sends audio data to the Google Speech API and prints word offset information.
vision/detect Command detect uses the Vision API's capabilities to detect several types of content (label, text, location, etc) for the given image.
vision/label Command label uses the Vision API's label detection capabilities to find a label based on an image's content.

Privacy

Path Description
dlp Samples for the Data Loss Prevention API.