15 #ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GRPC_OPTIONS_H
16 #define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_GRPC_OPTIONS_H
18 #include "google/cloud/background_threads.h"
19 #include "google/cloud/completion_queue.h"
20 #include "google/cloud/options.h"
21 #include "google/cloud/tracing_options.h"
22 #include "google/cloud/version.h"
23 #include <grpcpp/grpcpp.h>
35 using Type = std::shared_ptr<grpc::ChannelCredentials>;
66 using Type = std::map<std::string, std::string>;
87 using Type = grpc::ChannelArguments;
109 using Type = std::size_t;
127 using BackgroundThreadsFactory =
147 using Type = BackgroundThreadsFactory;
153 using GrpcOptionList =
171 struct GrpcSetupOption {
172 using Type = std::function<
void(grpc::ClientContext&)>;
187 struct GrpcSetupPollOption {
188 using Type = std::function<
void(grpc::ClientContext&)>;
192 void ConfigureContext(grpc::ClientContext& context,
Options const& opts);
195 void ConfigurePollContext(grpc::ClientContext& context,
Options const& opts);
198 grpc::ChannelArguments MakeChannelArguments(
Options const& opts);
201 absl::optional<
int> GetIntChannelArgument(grpc::ChannelArguments
const& args,
202 std::string
const& key);
205 absl::optional<std::string> GetStringChannelArgument(
206 grpc::ChannelArguments
const& args, std::string
const& key);
214 BackgroundThreadsFactory MakeBackgroundThreadsFactory(
Options const& opts
= {});