talos_rust_client/generated/
cluster.rs1#[derive(serde::Serialize, serde::Deserialize)]
3#[serde(rename_all = "camelCase")]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct HealthCheckRequest {
6 #[prost(message, optional, tag = "1")]
7 pub wait_timeout: ::core::option::Option<super::google::protobuf::Duration>,
8 #[prost(message, optional, tag = "2")]
9 pub cluster_info: ::core::option::Option<ClusterInfo>,
10}
11#[derive(serde::Serialize, serde::Deserialize)]
12#[serde(rename_all = "camelCase")]
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct ClusterInfo {
15 #[prost(string, repeated, tag = "1")]
16 pub control_plane_nodes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
17 #[prost(string, repeated, tag = "2")]
18 pub worker_nodes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
19 #[prost(string, tag = "3")]
20 pub force_endpoint: ::prost::alloc::string::String,
21}
22#[derive(serde::Serialize, serde::Deserialize)]
23#[serde(rename_all = "camelCase")]
24#[derive(Clone, PartialEq, ::prost::Message)]
25pub struct HealthCheckProgress {
26 #[prost(message, optional, tag = "1")]
27 pub metadata: ::core::option::Option<super::common::Metadata>,
28 #[prost(string, tag = "2")]
29 pub message: ::prost::alloc::string::String,
30}
31pub mod cluster_service_client {
33 #![allow(
34 unused_variables,
35 dead_code,
36 missing_docs,
37 clippy::wildcard_imports,
38 clippy::let_unit_value,
39 )]
40 use tonic::codegen::*;
41 use tonic::codegen::http::Uri;
42 #[derive(Debug, Clone)]
44 pub struct ClusterServiceClient<T> {
45 inner: tonic::client::Grpc<T>,
46 }
47 impl ClusterServiceClient<tonic::transport::Channel> {
48 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
50 where
51 D: TryInto<tonic::transport::Endpoint>,
52 D::Error: Into<StdError>,
53 {
54 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
55 Ok(Self::new(conn))
56 }
57 }
58 impl<T> ClusterServiceClient<T>
59 where
60 T: tonic::client::GrpcService<tonic::body::BoxBody>,
61 T::Error: Into<StdError>,
62 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
63 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
64 {
65 pub fn new(inner: T) -> Self {
66 let inner = tonic::client::Grpc::new(inner);
67 Self { inner }
68 }
69 pub fn with_origin(inner: T, origin: Uri) -> Self {
70 let inner = tonic::client::Grpc::with_origin(inner, origin);
71 Self { inner }
72 }
73 pub fn with_interceptor<F>(
74 inner: T,
75 interceptor: F,
76 ) -> ClusterServiceClient<InterceptedService<T, F>>
77 where
78 F: tonic::service::Interceptor,
79 T::ResponseBody: Default,
80 T: tonic::codegen::Service<
81 http::Request<tonic::body::BoxBody>,
82 Response = http::Response<
83 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
84 >,
85 >,
86 <T as tonic::codegen::Service<
87 http::Request<tonic::body::BoxBody>,
88 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
89 {
90 ClusterServiceClient::new(InterceptedService::new(inner, interceptor))
91 }
92 #[must_use]
97 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
98 self.inner = self.inner.send_compressed(encoding);
99 self
100 }
101 #[must_use]
103 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
104 self.inner = self.inner.accept_compressed(encoding);
105 self
106 }
107 #[must_use]
111 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
112 self.inner = self.inner.max_decoding_message_size(limit);
113 self
114 }
115 #[must_use]
119 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
120 self.inner = self.inner.max_encoding_message_size(limit);
121 self
122 }
123 pub async fn health_check(
124 &mut self,
125 request: impl tonic::IntoRequest<super::HealthCheckRequest>,
126 ) -> std::result::Result<
127 tonic::Response<tonic::codec::Streaming<super::HealthCheckProgress>>,
128 tonic::Status,
129 > {
130 self.inner
131 .ready()
132 .await
133 .map_err(|e| {
134 tonic::Status::unknown(
135 format!("Service was not ready: {}", e.into()),
136 )
137 })?;
138 let codec = tonic::codec::ProstCodec::default();
139 let path = http::uri::PathAndQuery::from_static(
140 "/cluster.ClusterService/HealthCheck",
141 );
142 let mut req = request.into_request();
143 req.extensions_mut()
144 .insert(GrpcMethod::new("cluster.ClusterService", "HealthCheck"));
145 self.inner.server_streaming(req, path, codec).await
146 }
147 }
148}