aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/json
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-06-29 14:48:05 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-07-11 15:17:35 -0700
commit018498a06be9188bda95b5753e2aa93db2b5a28f (patch)
tree5468fbd971f3a223b112c97026fc6ea6bed21a15 /src/core/lib/json
parent4ba4d18960ccc762d5228a314c574050afadddac (diff)
Implements subchannel refs for pick_first
Diffstat (limited to 'src/core/lib/json')
-rw-r--r--src/core/lib/json/json.cc10
-rw-r--r--src/core/lib/json/json.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/src/core/lib/json/json.cc b/src/core/lib/json/json.cc
index 816241bbf0..6d359573f8 100644
--- a/src/core/lib/json/json.cc
+++ b/src/core/lib/json/json.cc
@@ -18,10 +18,12 @@
#include <grpc/support/port_platform.h>
+#include <inttypes.h>
#include <string.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
#include "src/core/lib/json/json.h"
@@ -84,3 +86,11 @@ grpc_json* grpc_json_create_child(grpc_json* sibling, grpc_json* parent,
child->key = key;
return child;
}
+
+grpc_json* grpc_json_add_number_string_child(grpc_json* parent, grpc_json* it,
+ const char* name, int64_t num) {
+ char* num_str;
+ gpr_asprintf(&num_str, "%" PRId64, num);
+ return grpc_json_create_child(it, parent, name, num_str, GRPC_JSON_STRING,
+ true);
+}
diff --git a/src/core/lib/json/json.h b/src/core/lib/json/json.h
index f93b43048b..8742774b5f 100644
--- a/src/core/lib/json/json.h
+++ b/src/core/lib/json/json.h
@@ -91,4 +91,8 @@ grpc_json* grpc_json_create_child(grpc_json* sibling, grpc_json* parent,
const char* key, const char* value,
grpc_json_type type, bool owns_value);
+/* TODO */
+grpc_json* grpc_json_add_number_string_child(grpc_json* parent, grpc_json* it,
+ const char* name, int64_t num);
+
#endif /* GRPC_CORE_LIB_JSON_JSON_H */