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>
37 using Type = std::shared_ptr<grpc::ChannelCredentials>;
79 using Type = std::map<std::string, std::string>;
102 using Type = grpc::ChannelArguments;
128 using Type = std::size_t;
148 using BackgroundThreadsFactory =
170 using Type = BackgroundThreadsFactory;
176 using GrpcOptionList =
194 struct GrpcSetupOption {
195 using Type = std::function<
void(grpc::ClientContext&)>;
210 struct GrpcSetupPollOption {
211 using Type = std::function<
void(grpc::ClientContext&)>;
215 void ConfigureContext(grpc::ClientContext& context,
Options const& opts);
218 void ConfigurePollContext(grpc::ClientContext& context,
Options const& opts);
221 grpc::ChannelArguments MakeChannelArguments(
Options const& opts);
224 absl::optional<
int> GetIntChannelArgument(grpc::ChannelArguments
const& args,
225 std::string
const& key);
228 absl::optional<std::string> GetStringChannelArgument(
229 grpc::ChannelArguments
const& args, std::string
const& key);
237 BackgroundThreadsFactory MakeBackgroundThreadsFactory(
Options const& opts
= {});