By default, several environment variables are read to configure the client:
CLOUD_STORAGE_EMULATOR_ENDPOINT: if set, use this http endpoint to make all http requests instead of the production GCS service. Also, if set, the CreateDefaultClientOptions() function will use an AnonymousCredentials object instead of loading Application Default Credentials.
CLOUD_STORAGE_ENABLE_CLOG: if set, enable std::clog as a backend for google::cloud::LogSink.
CLOUD_STORAGE_ENABLE_TRACING: if set, this is the list of components that will have logging enabled, the component this is:
how to authenticate to the client. Using a nullptr for credentials results in undefined behavior.
channel_options
ChannelOptions
the configuration for SSL certificate validation.
Functions
download_stall_timeout() const
Control the maximum amount of time allowed for "stalls" during a download.
A download that receives no data is considered "stalled". If the download remains stalled for more than the time set in this option then the download is aborted.
The default value is 2 minutes. Can be disabled by setting the value to 0.
If true and using OpenSSL 1.0.2 the library configures the OpenSSL callbacks for locking.
Returns
Type
Description
bool
set_enable_ssl_locking_callbacks(bool)
If true and using OpenSSL 1.0.2 the library configures the OpenSSL callbacks for locking.
Parameter
Name
Description
v
bool
Returns
Type
Description
ClientOptions &
enable_sigpipe_handler() const
Returns
Type
Description
bool
set_enable_sigpipe_handler(bool)
Parameter
Name
Description
v
bool
Returns
Type
Description
ClientOptions &
maximum_socket_recv_size() const
Returns
Type
Description
std::size_t
set_maximum_socket_recv_size(std::size_t)
Parameter
Name
Description
v
std::size_t
Returns
Type
Description
ClientOptions &
maximum_socket_send_size() const
Returns
Type
Description
std::size_t
set_maximum_socket_send_size(std::size_t)
Parameter
Name
Description
v
std::size_t
Returns
Type
Description
ClientOptions &
channel_options()
Returns
Type
Description
ChannelOptions &
channel_options() const
Returns
Type
Description
ChannelOptions const &
static CreateDefaultClientOptions()
Creates a ClientOptions with Google Application Default Credentials.
If Application Default Credentials could not be loaded, this returns a Status with failure details. If the CLOUD_STORAGE_EMULATOR_ENDPOINT environment variable is set, this function instead uses an AnonymousCredentials to configure the client.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-19 UTC."],[],[]]