Skip to main content

Crate rskit_grpc

Crate rskit_grpc 

Source
Expand description

§rskit-grpc

gRPC transport and status mapping entrypoint for rskit.

§Always Available

  • Status mapping between tonic::Status and rskit_errors::AppError

§Features

  • client (default): lazy tonic channels with TLS-aware dialing and optional discovery
  • discovery: enables DiscoveryChannel

§Usage

[dependencies]
rskit-grpc = { version = "0.2.0-alpha.1", features = ["client", "discovery"] }
use rskit_grpc::{GrpcChannel, GrpcClientConfig};

let client = GrpcChannel::new(GrpcClientConfig::new("localhost:50051"));

§Discovery reconnect contract

DiscoveryChannel only advances its cached target after a connection succeeds. Failed background reconnect attempts leave the previously connected target in place so watcher/poll updates keep retrying the same discovered endpoint until it becomes reachable.

§TLS policy

Client TLS uses rskit_security::TlsConfig so CA bundles, server-name overrides, and client certificate/key material share the same shape as other transports. skip_verify is rejected for gRPC clients. tonic/rustls provides the protocol defaults: TLS 1.3 preferred, TLS 1.2 minimum, and no legacy protocols. gRPC transport and status-mapping entrypoints for rskit.

rskit-grpc always owns tonic::Statusrskit_errors::AppError mapping so client and server crates share one canonical transport boundary. With the client feature enabled, it also owns lazy channels, TLS-aware dialing, and optional discovery integration.

Lifecycle-managed gRPC servers are owned by rskit-server.

Re-exports§

pub use channel::GrpcChannel;
pub use config::GrpcClientConfig;
pub use errors::app_error_to_status;
pub use errors::error_code_to_grpc_code;
pub use errors::grpc_code_to_error_code;
pub use errors::status_to_app_error;
pub use discovery::DiscoveryChannel;
pub use discovery::DiscoveryChannelConfig;

Modules§

channel
gRPC channel wrapper with lazy connection management.
config
gRPC client configuration.
discovery
Service discovery integration.
errors
Error mapping between tonic Status and AppError.

Structs§

GrpcClientTlsConfig
TLS material and peer-verification settings shared by transport crates.