What is it?
google-cloud
is a client library for accessing Google
Cloud Platform services that significantly reduces the boilerplate
code you have to write. The library provides high-level API
abstractions so they're easier to understand. It embraces
idioms of C++, works well with the standard library, and
integrates better with your codebase.
All this means you spend more time creating code that matters
to you.
google-cloud
is configured to access Google Cloud Platform
services and authorize (OAuth 2.0) automatically on your behalf.
Add the google-cloud
dependency to your project and get a private key to be
up and ready to go. Better yet, if you are running on Compute Engine, the private key is
automatically detected.
Example: Retrieve Cloud Bigtable Rows
#include <bigtable/client/table.h>
// Use Application Default Credentials for authentication.
auto client = bigtable::CreateDefaultDataClient(
"my-project", "my-instance",
bigtable::ClientOptions());
bigtable::Table table(client, "my-table");
for (auto& row : table.ReadRows(
bigtable::RowRange::InfiniteRange(),
bigtable::Filter::PassAllFilter())) {
auto count = std::distance(
row.cells().begin(), row.cells().end());
std::cout << row.row_key() << " has " << count << " cells\n";
}
FAQ
What is the relationship between the google-cloud
library and the gcloud
command-line tool?
Both the gcloud
command-line tool and google-cloud
library are a part of the
Google Cloud SDK: a collection of tools and libraries that enable you to easily create and manage
resources on the Google Cloud Platform. The gcloud
command-line tool can be used to
manage both your development workflow and your Google Cloud Platform resources while the
google-cloud
library is the Google Cloud Client Library for C++.
What is the relationship between google-cloud
and the Google APIs C++ Client?
The Google APIs C++ Client is a client
library for using the broad set of Google APIs. google-cloud
is built specifically for the
Google Cloud Platform and is the recommended way to integrate Google Cloud APIs into your C++
applications. If your application requires both Google Cloud Platform and other Google APIs, the 2
libraries may be used by your application.