Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
Loading...
Searching...
No Matches
Classes | Functions
google::cloud::storage_experimental Namespace Reference

Contains experimental features for the GCS C++ Client Library. More...

Classes

class  AsyncClient
 A client for Google Cloud Storage offering asynchronous operations. More...
 
struct  AsyncReadObjectRangeResponse
 Represents the response from reading a subset of an object. More...
 
struct  GrpcPluginOption
 Configure the GCS+gRPC plugin. More...
 
struct  HttpVersionOption
 Set the HTTP version used by the client. More...
 

Functions

AsyncClient MakeAsyncClient (Options opts={})
 Creates a new GCS client exposing asynchronous APIs. More...
 
google::cloud::storage::Client DefaultGrpcClient (Options opts={})
 Create a google::cloud::storage::Client object configured to use gRPC. More...
 

Detailed Description

Contains experimental features for the GCS C++ Client Library.

Warning
The types, functions, aliases, and objects in this namespace are subject to change without notice. Some of these features depend on aspects of the service that are not generally available, do not have an SLA, and may require projects to be allow-listed.

Function Documentation

◆ DefaultGrpcClient()

google::cloud::storage::Client google::cloud::storage_experimental::DefaultGrpcClient ( Options  opts = {})

Create a google::cloud::storage::Client object configured to use gRPC.

Note
The Credentials parameter in the configuration is ignored. The gRPC client only supports Google Default Credentials.
Parameters
optsthe configuration parameters for the Client.
Warning
This is an experimental feature, and subject to change without notice.
Example
void GrpcReadWrite(std::string const& bucket_name) {
namespace gcs = ::google::cloud::storage;
auto constexpr kText = R"""(Hello World!)""";
auto object = client.InsertObject(bucket_name, "lorem.txt", kText);
if (!object) throw std::move(object).status();
auto input = client.ReadObject(bucket_name, "lorem.txt",
gcs::Generation(object->generation()));
std::string const actual(std::istreambuf_iterator<char>{input}, {});
std::cout << "The contents read back are:\n"
<< actual
<< "\nThe received checksums are: " << input.received_hash()
<< "\nThe computed checksums are: " << input.computed_hash()
<< "\nThe original hashes are: crc32c=" << object->crc32c()
<< ",md5=" << object->md5_hash() << "\n";
}
google::cloud::storage::Client DefaultGrpcClient(Options opts={})
Create a google::cloud::storage::Client object configured to use gRPC.

◆ MakeAsyncClient()

AsyncClient google::cloud::storage_experimental::MakeAsyncClient ( Options  opts = {})

Creates a new GCS client exposing asynchronous APIs.