Asynchronous gRPC driver.
Namespaces | |
namespace | client |
Client-side utilities. | |
namespace | server |
Server-side utilities. | |
namespace | tests |
userver gRPC testing facilities | |
Functions | |
grpc::ByteBuffer | SerializeToByteBuffer (const ::google::protobuf::Message &message, std::size_t block_size=kDefaultSerializeBlockSize) |
Serialize a Protobuf message to the wire format. | |
bool | ParseFromByteBuffer (grpc::ByteBuffer &&buffer, ::google::protobuf::Message &message) |
Parse a Protobuf message from the wire format. | |
formats::json::Value | MessageToJson (const google::protobuf::Message &message) |
Returns formats::json::Value representation of protobuf message. | |
std::string | ToString (const google::protobuf::Message &message) |
Converts message to human readable string. | |
std::string | ToJsonString (const google::protobuf::Message &message) |
Returns Json-string representation of protobuf message. | |
grpc::StatusCode | StatusCodeFromString (std::string_view str) |
Convert string to grpc::StatusCode. | |
std::string_view | ToString (grpc::StatusCode code) noexcept |
Convert grpc::StatusCode to string. | |
Variables | |
constexpr std::size_t | kDefaultSerializeBlockSize = 4096 |
formats::json::Value ugrpc::MessageToJson | ( | const google::protobuf::Message & | message | ) |
Returns formats::json::Value representation of protobuf message.
SerializationError |
bool ugrpc::ParseFromByteBuffer | ( | grpc::ByteBuffer && | buffer, |
::google::protobuf::Message & | message ) |
Parse a Protobuf message from the wire format.
buffer | the buffer that might be tempered with during deserialization |
message | will contain the parsing result on success |
true
on success, false
if buffer does not contain a valid message, according to the derived type of message grpc::ByteBuffer ugrpc::SerializeToByteBuffer | ( | const ::google::protobuf::Message & | message, |
std::size_t | block_size = kDefaultSerializeBlockSize ) |
Serialize a Protobuf message to the wire format.
message | the message to serialize |
block_size | can be used for performance tuning, too small chunk size results in extra allocations, too large chunk size results in wasting memory |
std::runtime_error | on serialization errors (supposedly only happens on extremely rare allocation failures or proto reflection malfunctioning). |
grpc::StatusCode ugrpc::StatusCodeFromString | ( | std::string_view | str | ) |
Convert string to grpc::StatusCode.
std::runtime_error |
std::string ugrpc::ToJsonString | ( | const google::protobuf::Message & | message | ) |
Returns Json-string representation of protobuf message.
formats::json::Exception |
|
inlineconstexpr |
Definition at line 16 of file byte_buffer_utils.hpp.