Namespaces | Functions
grpc_tool.cc File Reference
#include <grpc/support/port_platform.h>
#include "test/cpp/util/grpc_tool.h"
#include <cstdio>
#include <fstream>
#include <iostream>
#include <memory>
#include <sstream>
#include <string>
#include <thread>
#include "absl/flags/flag.h"
#include "absl/memory/memory.h"
#include <grpc/grpc.h>
#include <grpcpp/channel.h>
#include <grpcpp/create_channel.h>
#include <grpcpp/grpcpp.h>
#include <grpcpp/security/credentials.h>
#include <grpcpp/support/string_ref.h>
#include "test/cpp/util/cli_call.h"
#include "test/cpp/util/proto_file_parser.h"
#include "test/cpp/util/proto_reflection_descriptor_database.h"
#include "test/cpp/util/service_describer.h"
#include <unistd.h>
Include dependency graph for grpc_tool.cc:

Go to the source code of this file.

Namespaces

 grpc
 
 grpc::testing
 

Functions

 ABSL_FLAG (bool, batch, false, "Input contains multiple requests. Please do not use this to send " "more than a few RPCs. gRPC CLI has very different performance " "characteristics compared with normal RPC calls which make it " "unsuitable for loadtesting or significant production traffic.")
 
 ABSL_FLAG (bool, binary_input, false, "Input in binary format")
 
 ABSL_FLAG (bool, binary_output, false, "Output in binary format")
 
 ABSL_FLAG (bool, display_peer_address, false, "Log the peer socket address of the connection that each RPC is made " "on to stderr.")
 
 ABSL_FLAG (bool, json_input, false, "Input in json format")
 
 ABSL_FLAG (bool, json_output, false, "Output in json format")
 
 ABSL_FLAG (bool, l, false, "Use a long listing format")
 
 ABSL_FLAG (bool, remotedb, true, "Use server types to parse and format messages")
 
 ABSL_FLAG (double, timeout, -1, "Specify timeout in seconds, used to set the deadline for all " "RPCs. The default value of -1 means no deadline has been set.")
 
 ABSL_FLAG (std::string, default_service_config, "", "Default service config to use on the channel, if non-empty. Note " "that this will be ignored if the name resolver returns a service " "config.")
 
 ABSL_FLAG (std::string, infile, "", "Input file (default is stdin)")
 
 ABSL_FLAG (std::string, metadata, "", "Metadata to send to server, in the form of key1:val1:key2:val2")
 
 ABSL_FLAG (std::string, proto_path, ".", "Path to look for the proto file. " "Multiple paths can be separated by " GRPC_CLI_PATH_SEPARATOR)
 
 ABSL_FLAG (std::string, protofiles, "", "Name of the proto file.")
 
int grpc::testing::GrpcToolMainLib (int argc, const char **argv, const CliCredentials &cred, const GrpcToolOutputCallback &callback)
 

Function Documentation

◆ ABSL_FLAG() [1/14]

ABSL_FLAG ( bool  ,
batch  ,
false  ,
"Input contains multiple requests. Please do not use this to send " "more than a few RPCs. gRPC CLI has very different performance " "characteristics compared with normal RPC calls which make it " "unsuitable for loadtesting or significant production traffic."   
)

◆ ABSL_FLAG() [2/14]

ABSL_FLAG ( bool  ,
binary_input  ,
false  ,
"Input in binary format"   
)

◆ ABSL_FLAG() [3/14]

ABSL_FLAG ( bool  ,
binary_output  ,
false  ,
"Output in binary format"   
)

◆ ABSL_FLAG() [4/14]

ABSL_FLAG ( bool  ,
display_peer_address  ,
false  ,
"Log the peer socket address of the connection that each RPC is made " "on to stderr."   
)

◆ ABSL_FLAG() [5/14]

ABSL_FLAG ( bool  ,
json_input  ,
false  ,
"Input in json format"   
)

◆ ABSL_FLAG() [6/14]

ABSL_FLAG ( bool  ,
json_output  ,
false  ,
"Output in json format"   
)

◆ ABSL_FLAG() [7/14]

ABSL_FLAG ( bool  ,
,
false  ,
"Use a long listing format"   
)

◆ ABSL_FLAG() [8/14]

ABSL_FLAG ( bool  ,
remotedb  ,
true  ,
"Use server types to parse and format messages"   
)

◆ ABSL_FLAG() [9/14]

ABSL_FLAG ( double  ,
timeout  ,
1,
"Specify timeout in  seconds,
used to set the deadline for all " "RPCs. The default value of -1 means no deadline has been set."   
)

◆ ABSL_FLAG() [10/14]

ABSL_FLAG ( std::string  ,
default_service_config  ,
""  ,
"Default service config to use on the  channel,
if non-empty. Note " "that this will be ignored if the name resolver returns a service " "config."   
)

◆ ABSL_FLAG() [11/14]

ABSL_FLAG ( std::string  ,
infile  ,
""  ,
"Input file (default is stdin)"   
)

◆ ABSL_FLAG() [12/14]

ABSL_FLAG ( std::string  ,
metadata  ,
""  ,
"Metadata to send to  server,
in the form of key1:val1:key2:val2"   
)

◆ ABSL_FLAG() [13/14]

ABSL_FLAG ( std::string  ,
proto_path  ,
"."  ,
"Path to look for the proto file. " "Multiple paths can be separated by "  GRPC_CLI_PATH_SEPARATOR 
)

◆ ABSL_FLAG() [14/14]

ABSL_FLAG ( std::string  ,
protofiles  ,
""  ,
"Name of the proto file."   
)

Variable Documentation

◆ command

const char* command

Definition at line 247 of file grpc_tool.cc.

◆ cred_usage_

const std::string cred_usage_
private

Definition at line 123 of file grpc_tool.cc.

◆ function

std::function<bool(GrpcTool*, int, const char**, const CliCredentials&, GrpcToolOutputCallback)> function

Definition at line 250 of file grpc_tool.cc.

◆ max_args

int max_args

Definition at line 252 of file grpc_tool.cc.

◆ min_args

int min_args

Definition at line 251 of file grpc_tool.cc.

◆ print_command_usage_

bool print_command_usage_
private

Definition at line 121 of file grpc_tool.cc.

◆ usage_exit_status_

int usage_exit_status_
private

Definition at line 122 of file grpc_tool.cc.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:16