cloud

package module
v0.0.0-...-2bcf714 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

README

The Go Cloud Project

Write once, run on any cloud ☁️

Build Status godoc

The Go Cloud Project is an initiative that will allow application developers to seamlessly deploy cloud applications on any combination of cloud providers. It does this by providing stable, idiomatic interfaces for common uses like storage and databases. Think database/sql for cloud products.

A key part of the project is to also provide a code generator called Wire. It creates human-readable code that only imports the cloud SDKs for providers you use. This allows Go Cloud to grow to support any number of cloud providers, without increasing compile times or binary sizes, and avoiding any side effects from init() functions.

Imagine writing this to read from blob storage (like Google Cloud Storage or S3):

blobReader, err := bucket.NewReader(context.Background(), "my-blob")

and being able to run that code on any cloud you want, avoiding all the ceremony of cloud-specific authorization, tracing, SDKs and all the other code required to make an application portable across cloud platforms.

You can learn more about the project from our announcement blog post, or our talk at Next 2018:

Installation instructions

go get github.com/google/go-cloud
go get github.com/google/go-cloud/wire/cmd/wire

Go Cloud builds at the latest stable release of Go. Previous Go versions may compile but are not supported.

Samples

samples/tutorial shows how to get started with the project by using blob storage.

samples/guestbook contains an example guestbook application (just like it's 1999!) that can be run locally, on Google Cloud Platform or on Amazon Web Services. The instructions take about 5 minutes to follow if running locally. If you want to see the guestbook app running on cloud resources, it will take about 30 minutes to follow, and uses Terraform to automatically provision the resources needed.

Project status

This project is in alpha and is not yet suitable for production.

While in alpha, the API is subject to breaking changes.

Current features

Go Cloud provides generic APIs for:

  • Unstructured binary (blob) storage
  • Variables that change at runtime (configuration)
  • Connecting to MySQL databases
  • Server startup and diagnostics: request logging, tracing, and health checking

Contributing

Thank you for your interest in contributing to Go Cloud! ❤

Everyone is welcome to contribute to Go Cloud, whether it's in the form of code, documentation, bug reports, feature requests, or anything else. We encourage you to experiment with Go Cloud and make contributions to help evolve it to meet your needs!

The GitHub repository at google/go-cloud currently contains Google Cloud Platform and Amazon Web Services implementations as examples to prove everything is working. Unfortunately, we cannot support every cloud provider directly from the project.

If you create a repository that implements the Go Cloud interfaces for other cloud providers, let us know! We would be happy to link to it here and give you a heads-up before making any breaking changes.

See the contributing guide for more details.

Community

You can contact us on the go-cloud mailing list.

This project is covered by the Go Code of Conduct.

Documentation

Overview

Package cloud contains a library and tools for open cloud development in Go.

The Go Cloud Project allows application developers to seamlessly deploy cloud applications on any combination of cloud providers. It does this by providing stable, idiomatic interfaces for common uses like storage and databases. Think `database/sql` for cloud products.

At the core of the project are common types implemented by cloud providers. For example, the blob.Bucket type can be created using gcsblob.OpenBucket, s3blob.OpenBucket, or any other provider. Then, the blob.Bucket can be used throughout your application without worrying about the underlying implementation.

This project also provides a code generator called Wire (https://github.com/Lioric/go-cloud/blob/master/wire/README.md). It creates human-readable code that only imports the cloud SDKs for providers you use. This allows Go Cloud to grow to support any number of cloud providers, without increasing compile times or binary sizes, and avoiding any side effects from `init()` functions.

For sample applications and a tutorial, see the samples directory (https://github.com/Lioric/go-cloud/tree/master/samples).

Directories

Path Synopsis
aws
Package aws provides fundamental Wire providers for Amazon Web Services (AWS).
Package aws provides fundamental Wire providers for Amazon Web Services (AWS).
awscloud
Package awscloud contains Wire providers for AWS services.
Package awscloud contains Wire providers for AWS services.
Package blob provides an easy way to interact with Blob objects within a bucket.
Package blob provides an easy way to interact with Blob objects within a bucket.
driver
Package driver defines a set of interfaces that the blob package uses to interact with the underlying blob services.
Package driver defines a set of interfaces that the blob package uses to interact with the underlying blob services.
drivertest
Package drivertest provides a conformance test for implementations of driver.
Package drivertest provides a conformance test for implementations of driver.
fileblob
Package fileblob provides a bucket implementation that operates on the local filesystem.
Package fileblob provides a bucket implementation that operates on the local filesystem.
gcsblob
Package gcsblob provides an implementation of using blob API on GCS.
Package gcsblob provides an implementation of using blob API on GCS.
s3blob
Package s3blob provides an implementation of using blob API on S3.
Package s3blob provides an implementation of using blob API on S3.
sqlfileblob
Package fileblob provides a bucket implementation that operates on the local filesystem.
Package fileblob provides a bucket implementation that operates on the local filesystem.
gcp
Package gcp provides fundamental Wire providers and types for Google Cloud Platform (GCP).
Package gcp provides fundamental Wire providers and types for Google Cloud Platform (GCP).
gcpcloud
Package gcpcloud contains Wire providers for GCP services.
Package gcpcloud contains Wire providers for GCP services.
Package health provides health check handlers.
Package health provides health check handlers.
sqlhealth
Package sqlhealth provides a health check for a SQL database connection.
Package sqlhealth provides a health check for a SQL database connection.
internal
testing/replay
Package replay provides the ability to record and replay HTTP requests.
Package replay provides the ability to record and replay HTTP requests.
mysql
cloudmysql
Package cloudmysql provides connections to managed MySQL Cloud SQL instances.
Package cloudmysql provides connections to managed MySQL Cloud SQL instances.
rdsmysql
Package rdsmysql provides connections to AWS RDS MySQL instances.
Package rdsmysql provides connections to AWS RDS MySQL instances.
Package requestlog provides an http.Handler that logs information about requests.
Package requestlog provides an http.Handler that logs information about requests.
Package runtimevar provides an interface for reading runtime variables and ability to detect changes and get updates on those variables.
Package runtimevar provides an interface for reading runtime variables and ability to detect changes and get updates on those variables.
driver
Package driver provides the interface for providers of runtimevar.
Package driver provides the interface for providers of runtimevar.
drivertest
Package drivertest provides a conformance test for implementations of runtimevar.
Package drivertest provides a conformance test for implementations of runtimevar.
filevar
Package filevar provides a runtimevar driver implementation to read configurations and ability to detect changes and get updates on local configuration files.
Package filevar provides a runtimevar driver implementation to read configurations and ability to detect changes and get updates on local configuration files.
filevar/_demo
This binary demonstrates watching over a configuration file using the runtimevar package with the filevar package as the driver implementation.
This binary demonstrates watching over a configuration file using the runtimevar package with the filevar package as the driver implementation.
internal
Package internal contains helper methods that shouldn't be part of the public API, but have to be exposed as they are required across runtimevar/ package boundaries.
Package internal contains helper methods that shouldn't be part of the public API, but have to be exposed as they are required across runtimevar/ package boundaries.
paramstore
Package paramstore reads parameters to the AWS Systems Manager Parameter Store.
Package paramstore reads parameters to the AWS Systems Manager Parameter Store.
runtimeconfigurator
Package runtimeconfigurator provides a runtimevar driver implementation to read configurations from Cloud Runtime Configurator service and ability to detect changes and get updates.
Package runtimeconfigurator provides a runtimevar driver implementation to read configurations from Cloud Runtime Configurator service and ability to detect changes and get updates.
samples
guestbook
guestbook is a sample application that records visitors' messages, displays a cloud banner, and an administrative message.
guestbook is a sample application that records visitors' messages, displays a cloud banner, and an administrative message.
guestbook/aws/provision_db
The provision_db program connects to an RDS database and initializes it with SQL from stdin.
The provision_db program connects to an RDS database and initializes it with SQL from stdin.
guestbook/gcp/deploy
The deploy program builds the Guestbook server locally and deploys it to GKE.
The deploy program builds the Guestbook server locally and deploys it to GKE.
guestbook/gcp/provision_db
The provision_db program connects to a Cloud SQL database and initializes it with SQL from a file.
The provision_db program connects to a Cloud SQL database and initializes it with SQL from a file.
tutorial
Command upload saves files to blob storage on GCP and AWS.
Command upload saves files to blob storage on GCP and AWS.
wire
The greeter binary simulates an event with greeters greeting guests.
The greeter binary simulates an event with greeters greeting guests.
Package server provides a preconfigured HTTP server with diagnostic hooks.
Package server provides a preconfigured HTTP server with diagnostic hooks.
sdserver
Package sdserver provides the diagnostic hooks for a server using Stackdriver.
Package sdserver provides the diagnostic hooks for a server using Stackdriver.
xrayserver
Package xrayserver provides the diagnostic hooks for a server using AWS X-Ray.
Package xrayserver provides the diagnostic hooks for a server using AWS X-Ray.
tests
gcp/app
The app command is a test app that is initialized with the GCP SDK.
The app command is a test app that is initialized with the GCP SDK.
internal/testutil
Package testutil contains utility functions used by server tests against different platforms.
Package testutil contains utility functions used by server tests against different platforms.
Package wire contains directives for Wire code generation.
Package wire contains directives for Wire code generation.
cmd/wire
Wire is a compile-time dependency injection tool.
Wire is a compile-time dependency injection tool.
internal/wire
Package wire provides compile-time dependency injection logic as a Go library.
Package wire provides compile-time dependency injection logic as a Go library.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL