Skip to content
Snippets Groups Projects
Commit dc5d60b8 authored by Mark D. Roth's avatar Mark D. Roth
Browse files

Allow setting service config via C++ API, for use in tests.

parent 4bbdda44
No related branches found
No related tags found
No related merge requests found
......@@ -90,6 +90,10 @@ class ChannelArguments {
/// grpclb LB policy will be used, regardless of what is specified here.
void SetLoadBalancingPolicyName(const grpc::string& lb_policy_name);
/// Set service config in JSON form.
/// Primarily meant for use in unit tests.
void SetServiceConfigJSON(const grpc::string& service_config_json);
// Generic channel argument setters. Only for advanced use cases.
/// Set an integer argument \a value under \a key.
void SetInt(const grpc::string& key, int value);
......
......@@ -125,6 +125,11 @@ void ChannelArguments::SetLoadBalancingPolicyName(
SetString(GRPC_ARG_LB_POLICY_NAME, lb_policy_name);
}
void ChannelArguments::SetServiceConfigJSON(
const grpc::string& service_config_json) {
SetString(GRPC_ARG_SERVICE_CONFIG, service_config_json);
}
void ChannelArguments::SetInt(const grpc::string& key, int value) {
grpc_arg arg;
arg.type = GRPC_ARG_INTEGER;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment