Google wants to make its Go language (Golang) a staple of cloud application development with its open source Go Cloud project, featuring a library and tools to build apps that can be ported across different clouds. Available in a very early beta version, Go Cloud is not yet suitable for production use.
Go offers cloud development benefits, including low latency and built-in concurrency. Go Cloud, meanwhile, provides APIs to write simpler, more-portable applications.
A set of generic APIs now cover:
- Unstructured binary (blob) storage.
- Variables that change at runtime.
- Connections to MySQL databases.
- Server startup and diagnostics, including request logging, tracing, and health-checking.
Go Cloud serves as a foundation for an ecosystem of portable cloud libraries to be built on these APIs. Currently, the Go Cloud GitHub repository has implementations for Google Cloud Platform and Amazon Web Services. Support for more cloud providers is planned soon.
Critical to the project is Wire, a code generator that creates human-readable code that imports cloud SDKs for the providers the developers use. This lets Go Cloud support cloud providers without increasing compile times or binary sizes while avoiding effects from
Wire automates the connecting of components using dependency injection. Component dependencies are represented as function parameters to encourage explicit initialization rather than global variables. Wire operates without a runtime state or reflection, thus enabling code for handwritten initialization.
Where to download Go Cloud
You can download Go Cloud from GitHub. Install it and Wire as follows:
go get github.com/google/go-cloud go get github.com/google/go-cloud/wire/cmd/wire