#include <proto_file_parser.h>
|
std::string | GetFormattedMethodName (const std::string &method) |
|
std::string | GetFormattedStringFromMessageType (const std::string &message_type_name, const std::string &serialized_proto, bool is_json_format) |
|
std::string | GetFormattedStringFromMethod (const std::string &method, const std::string &serialized_proto, bool is_request, bool is_json_format) |
|
std::string | GetFullMethodName (const std::string &method) |
|
std::string | GetSerializedProtoFromMessageType (const std::string &message_type_name, const std::string &formatted_proto, bool is_json_format) |
|
std::string | GetSerializedProtoFromMethod (const std::string &method, const std::string &formatted_proto, bool is_request, bool is_json_format) |
|
bool | HasError () const |
|
bool | IsStreaming (const std::string &method, bool is_request) |
|
void | LogError (const std::string &error_msg) |
|
| ProtoFileParser (const std::shared_ptr< grpc::Channel > &channel, const std::string &proto_path, const std::string &protofiles) |
|
| ~ProtoFileParser () |
|
Definition at line 40 of file proto_file_parser.h.
◆ ProtoFileParser()
grpc::testing::ProtoFileParser::ProtoFileParser |
( |
const std::shared_ptr< grpc::Channel > & |
channel, |
|
|
const std::string & |
proto_path, |
|
|
const std::string & |
protofiles |
|
) |
| |
◆ ~ProtoFileParser()
grpc::testing::ProtoFileParser::~ProtoFileParser |
( |
| ) |
|
◆ GetFormattedMethodName()
std::string grpc::testing::ProtoFileParser::GetFormattedMethodName |
( |
const std::string & |
method | ) |
|
◆ GetFormattedStringFromMessageType()
std::string grpc::testing::ProtoFileParser::GetFormattedStringFromMessageType |
( |
const std::string & |
message_type_name, |
|
|
const std::string & |
serialized_proto, |
|
|
bool |
is_json_format |
|
) |
| |
Converts a binary proto string to its text or json string representation for the given message type.
- Parameters
-
the | serialised binary proto representation of type message_type_name |
- Returns
- the text- or json-formatted proto string of
serialized_proto
Definition at line 288 of file proto_file_parser.cc.
◆ GetFormattedStringFromMethod()
std::string grpc::testing::ProtoFileParser::GetFormattedStringFromMethod |
( |
const std::string & |
method, |
|
|
const std::string & |
serialized_proto, |
|
|
bool |
is_request, |
|
|
bool |
is_json_format |
|
) |
| |
Converts a binary proto string to its text or json string representation for the given method's input or return type.
- Parameters
-
method | the name of the method (does not need to be a fully qualified name) |
the | serialised binary proto representation of type message_type_name |
- Returns
- the text- or json-formatted proto string of
serialized_proto
Definition at line 238 of file proto_file_parser.cc.
◆ GetFullMethodName()
std::string grpc::testing::ProtoFileParser::GetFullMethodName |
( |
const std::string & |
method | ) |
|
◆ GetMessageTypeFromMethod()
std::string grpc::testing::ProtoFileParser::GetMessageTypeFromMethod |
( |
const std::string & |
method, |
|
|
bool |
is_request |
|
) |
| |
|
private |
◆ GetSerializedProtoFromMessageType()
std::string grpc::testing::ProtoFileParser::GetSerializedProtoFromMessageType |
( |
const std::string & |
message_type_name, |
|
|
const std::string & |
formatted_proto, |
|
|
bool |
is_json_format |
|
) |
| |
Converts a text or json string to its proto representation for the given message type.
- Parameters
-
formatted_proto | the text- or json-formatted proto string |
- Returns
- the serialised binary proto representation of
formatted_proto
Definition at line 250 of file proto_file_parser.cc.
◆ GetSerializedProtoFromMethod()
std::string grpc::testing::ProtoFileParser::GetSerializedProtoFromMethod |
( |
const std::string & |
method, |
|
|
const std::string & |
formatted_proto, |
|
|
bool |
is_request, |
|
|
bool |
is_json_format |
|
) |
| |
Converts a text or json string to its binary proto representation for the given method's input or return type.
- Parameters
-
method | the name of the method (does not need to be fully qualified name) |
formatted_proto | the text- or json-formatted proto string |
is_request | if true the resolved type is that of the input parameter of the method, otherwise it is the output type |
is_json_format | if true the formatted_proto is treated as a json-formatted proto, otherwise it is treated as a text-formatted proto |
- Returns
- the serialised binary proto representation of
formatted_proto
Definition at line 226 of file proto_file_parser.cc.
◆ HasError()
bool grpc::testing::ProtoFileParser::HasError |
( |
| ) |
const |
|
inline |
◆ IsStreaming()
bool grpc::testing::ProtoFileParser::IsStreaming |
( |
const std::string & |
method, |
|
|
bool |
is_request |
|
) |
| |
◆ LogError()
void grpc::testing::ProtoFileParser::LogError |
( |
const std::string & |
error_msg | ) |
|
◆ desc_db_
◆ desc_pool_
◆ dynamic_factory_
◆ error_printer_
std::unique_ptr<ErrorPrinter> grpc::testing::ProtoFileParser::error_printer_ |
|
private |
◆ file_db_
◆ has_error_
bool grpc::testing::ProtoFileParser::has_error_ |
|
private |
◆ importer_
◆ known_methods_
std::unordered_map<std::string, std::string> grpc::testing::ProtoFileParser::known_methods_ |
|
private |
◆ reflection_db_
◆ request_prototype_
◆ request_text_
std::string grpc::testing::ProtoFileParser::request_text_ |
|
private |
◆ response_prototype_
◆ service_desc_list_
◆ source_tree_
The documentation for this class was generated from the following files: