|
Network System 0.1.1
High-performance modular networking library for scalable client-server applications
|
gRPC protocol implementation More...
Namespaces | |
| namespace | compression |
| gRPC compression algorithms | |
| namespace | header_names |
| gRPC request header names | |
| namespace | trailer_names |
| gRPC trailing header names | |
Classes | |
| class | bidi_stream_impl |
| struct | call_options |
| Options for individual RPC calls. More... | |
| struct | channel_credentials_config |
| Configuration for gRPC channel credentials. More... | |
| class | client_stream_writer_impl |
| class | generic_service |
| A service that allows dynamic method registration. More... | |
| struct | grpc_channel_config |
| Configuration for gRPC channel. More... | |
| class | grpc_client |
| gRPC client for making RPC calls More... | |
| struct | grpc_message |
| gRPC message with compression flag and payload More... | |
| class | grpc_server |
| gRPC server for handling RPC requests More... | |
| struct | grpc_server_config |
| Configuration for gRPC server. More... | |
| class | grpc_service |
| Base class for gRPC service implementations. More... | |
| struct | grpc_status |
| gRPC status with code, message, and optional details More... | |
| struct | grpc_trailers |
| gRPC trailing metadata containing status information More... | |
| class | health_service |
| Implementation of gRPC health checking protocol. More... | |
| struct | method_descriptor |
| Describes a single RPC method within a service. More... | |
| struct | method_handler |
| struct | registry_config |
| Configuration for service registry. More... | |
| class | server_context |
| Context for handling a single RPC request. More... | |
| class | server_reader |
| Reader interface for client streaming. More... | |
| class | server_reader_writer |
| Reader/writer interface for bidirectional streaming. More... | |
| class | server_stream_reader_impl |
| class | server_writer |
| Writer interface for server streaming. More... | |
| class | service_base |
| Base class for all gRPC service implementations. More... | |
| struct | service_descriptor |
| Describes a gRPC service and its methods. More... | |
| class | service_registry |
| Central registry for managing gRPC services. More... | |
Typedefs | |
| using | grpc_metadata = std::vector<std::pair<std::string, std::string>> |
| Metadata key-value pair for gRPC requests/responses. | |
| using | unary_handler |
| Handler function type for unary RPC. | |
| using | server_streaming_handler |
| Handler function type for server streaming RPC. | |
| using | client_streaming_handler |
| Handler function type for client streaming RPC. | |
| using | bidi_streaming_handler |
| Handler function type for bidirectional streaming RPC. | |
Enumerations | |
| enum class | method_type { unary , server_streaming , client_streaming , bidi_streaming , unary , server_streaming , client_streaming , bidi_streaming } |
| Type of RPC method. More... | |
| enum class | health_status { unknown , serving , not_serving , service_unknown } |
| Health status for a service. More... | |
| enum class | status_code : uint32_t { ok = 0 , cancelled = 1 , unknown = 2 , invalid_argument = 3 , deadline_exceeded = 4 , not_found = 5 , already_exists = 6 , permission_denied = 7 , resource_exhausted = 8 , failed_precondition = 9 , aborted = 10 , out_of_range = 11 , unimplemented = 12 , internal = 13 , unavailable = 14 , data_loss = 15 , unauthenticated = 16 } |
| gRPC status codes (as defined in grpc/status.h) More... | |
| enum class | method_type { unary , server_streaming , client_streaming , bidi_streaming , unary , server_streaming , client_streaming , bidi_streaming } |
Functions | |
| auto | parse_timeout (std::string_view timeout_str) -> uint64_t |
| Parse timeout string (e.g., "10S", "100m", "1000u") | |
| auto | format_timeout (uint64_t timeout_ms) -> std::string |
| Format timeout as gRPC timeout string. | |
| auto | parse_method_path (std::string_view full_path) -> std::optional< std::pair< std::string, std::string > > |
| Parse full method path into service and method names. | |
| auto | build_method_path (std::string_view service_name, std::string_view method_name) -> std::string |
| Build full method path from service and method names. | |
| constexpr auto | status_code_to_string (status_code code) -> std::string_view |
| Convert status code to string. | |
Variables | |
| constexpr size_t | grpc_header_size = 5 |
| gRPC message header size (5 bytes) | |
| constexpr size_t | default_max_message_size = 4 * 1024 * 1024 |
| Maximum gRPC message size (default 4MB) | |
| constexpr const char * | grpc_content_type = "application/grpc" |
| gRPC content-type header value | |
| constexpr const char * | grpc_content_type_proto = "application/grpc+proto" |
| gRPC content-type with proto encoding | |
gRPC protocol implementation
This namespace contains all gRPC-related types and functions:
All types use the Result<T>/VoidResult pattern for error handling, providing consistent error reporting across the library.
Handler function type for client streaming RPC.
| ctx | Server context |
| reader | Reader for incoming messages |
| using kcenon::network::protocols::grpc::grpc_metadata = std::vector<std::pair<std::string, std::string>> |
Handler function type for server streaming RPC.
| ctx | Server context |
| request | Serialized request message |
| writer | Writer to send response messages |
Handler function type for unary RPC.
| ctx | Server context |
| request | Serialized request message |
|
strong |
Health status for a service.
| Enumerator | |
|---|---|
| unknown | Status unknown. |
| serving | Service is serving. |
| not_serving | Service is not serving. |
| service_unknown | Service is not registered. |
Definition at line 563 of file service_registry.h.
|
strong |
Type of RPC method.
Definition at line 60 of file service_registry.h.
|
strong |
Definition at line 594 of file server.cpp.
|
strong |
gRPC status codes (as defined in grpc/status.h)
Standard gRPC status codes for RPC operations. See: https://grpc.github.io/grpc/core/md_doc_statuscodes.html
Definition at line 35 of file status.h.
| auto kcenon::network::protocols::grpc::build_method_path | ( | std::string_view | service_name, |
| std::string_view | method_name ) -> std::string |
Build full method path from service and method names.
| service_name | Full service name (e.g., "package.Service") |
| method_name | Method name |
Definition at line 58 of file service_registry.cpp.
Referenced by kcenon::network::protocols::grpc::generic_service::impl::register_bidi_streaming_method(), kcenon::network::protocols::grpc::generic_service::impl::register_client_streaming_method(), kcenon::network::protocols::grpc::generic_service::impl::register_server_streaming_method(), and kcenon::network::protocols::grpc::generic_service::impl::register_unary_method().

| auto kcenon::network::protocols::grpc::format_timeout | ( | uint64_t | timeout_ms | ) | -> std::string |
Format timeout as gRPC timeout string.
| timeout_ms | Timeout in milliseconds |
Definition at line 131 of file frame.cpp.
Referenced by kcenon::network::protocols::grpc::grpc_client::impl::bidi_stream_raw(), kcenon::network::protocols::grpc::grpc_client::impl::call_raw(), kcenon::network::protocols::grpc::grpc_client::impl::client_stream_raw(), and kcenon::network::protocols::grpc::grpc_client::impl::server_stream_raw().

| auto kcenon::network::protocols::grpc::parse_method_path | ( | std::string_view | full_path | ) | -> std::optional<std::pair<std::string, std::string>> |
Parse full method path into service and method names.
| full_path | Full method path (e.g., "/package.Service/Method") |
Definition at line 33 of file service_registry.cpp.
Referenced by kcenon::network::protocols::grpc::service_registry::impl::find_method().

| auto kcenon::network::protocols::grpc::parse_timeout | ( | std::string_view | timeout_str | ) | -> uint64_t |
Parse timeout string (e.g., "10S", "100m", "1000u")
| timeout_str | Timeout string with unit suffix |
Supported units:
Definition at line 88 of file frame.cpp.
|
constexpr |
Convert status code to string.
| code | Status code to convert |
Definition at line 61 of file status.h.
References aborted, already_exists, cancelled, data_loss, deadline_exceeded, failed_precondition, internal, invalid_argument, not_found, ok, out_of_range, permission_denied, resource_exhausted, unauthenticated, unavailable, unimplemented, and unknown.
Referenced by kcenon::network::protocols::grpc::grpc_client::impl::call_raw(), and kcenon::network::protocols::grpc::grpc_status::code_string().

|
constexpr |
Maximum gRPC message size (default 4MB)
Definition at line 40 of file frame.h.
Referenced by kcenon::network::protocols::grpc::grpc_message::parse().
|
constexpr |
gRPC content-type header value
Definition at line 109 of file frame.h.
Referenced by kcenon::network::protocols::grpc::grpc_client::impl::bidi_stream_raw(), kcenon::network::protocols::grpc::grpc_client::impl::call_raw(), kcenon::network::protocols::grpc::grpc_client::impl::client_stream_raw(), and kcenon::network::protocols::grpc::grpc_client::impl::server_stream_raw().
|
constexpr |
|
constexpr |
gRPC message header size (5 bytes)
gRPC messages are prefixed with a 5-byte header:
Definition at line 35 of file frame.h.
Referenced by kcenon::network::protocols::grpc::grpc_message::parse(), kcenon::network::protocols::grpc::grpc_message::serialize(), and kcenon::network::protocols::grpc::grpc_message::serialized_size().