Namespace google::cloud::storage_experimental (2.22.0)

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

Classes

AsyncClient

A client for Google Cloud Storage offering asynchronous operations.

AsyncConnection

The *Connection object for AsyncClient.

AsyncReader

A handle for streaming downloads.

AsyncReaderConnection

The *Connection object for AsyncReader.

AsyncRewriter

Perform object rewrites asynchronously.

AsyncRewriterConnection

An interface for asynchronous object rewrite implementations.

AsyncToken

Serialize streams of asynchronous operations.

AsyncWriter

Perform resumable uploads asynchronously.

AsyncWriterConnection

An interface to asynchronously perform resumable uploads.

ComposeObjectRequest

A request to compose multiple objects into a single object.

DeleteObjectRequest

A request to delete an object.

InsertObjectRequest

A request to insert object sans the data payload.

ReadObjectRequest

A request to read an object.

ReadPayload

A partial or full response to an asynchronous download.

ResumableUploadRequest

A request to start or resume a resumable upload.

RewriteObjectRequest

A request to compose multiple objects into a single object.

WritePayload

An opaque representation of the data for an object payload.

Structs

BufferedUploadHwmOption

Configure the flow control algorithm for buffered uploads.

BufferedUploadLwmOption

Configure the flow control algorithm for buffered uploads.

GrpcPluginOption

Configure the GCS+gRPC plugin.

HttpVersionOption

Set the HTTP version used by the client.

RewriteObjectResponse

The result of a (maybe partial) object rewrite.

Functions

DefaultGrpcClient(Options)

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

Example
void GrpcReadWrite(std::string const& bucket_name) {
  namespace gcs = ::google::cloud::storage;
  auto constexpr kText = R"""(Hello World!)""";

  auto client = google::cloud::storage_experimental::DefaultGrpcClient();

  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}, {});
  if (input.bad()) throw google::cloud::Status(input.status());
  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";
}
Parameter
NameDescription
opts

the configuration parameters for the Client.

Returns
TypeDescription
google::cloud::storage::Client