1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Automatically generated types, clients, and servers from [Kubernetes CRI Protobuf definitions](https://github.com/kubernetes/cri-api/tree/7d8ade91836419c9dd49d059bda1fe4a7dc283f5/pkg/apis/runtime).
//!
//! ## Examples
//!
//! Connecting over TCP:
//!
//! ```no_run
//! use k8s_cri::v1alpha2::runtime_service_client::RuntimeServiceClient;
//! use k8s_cri::v1alpha2::ListContainersRequest;
//! use tokio::main;
//!
//! #[tokio::main]
//! async fn main() {
//!     let mut client = RuntimeServiceClient::connect("http://[::1]:50051")
//!         .await
//!         .expect("Could not create client.");
//!
//!     let request = tonic::Request::new(ListContainersRequest { filter: None });
//!     let response = client
//!         .list_containers(request)
//!         .await
//!         .expect("Request failed.");
//!     println!("{:?}", response);
//! }
//! ```
//!
//! Connecting to a Unix domain socket:
//!
//! ```no_run
//! use std::convert::TryFrom;
//! use tokio::main;
//!
//! use k8s_cri::v1alpha2::runtime_service_client::RuntimeServiceClient;
//! use tokio::net::UnixStream;
//! use tonic::transport::{Channel, Endpoint, Uri};
//! use tower::service_fn;
//!
//! #[tokio::main]
//! async fn main() {
//!     let path = "/run/containerd/containerd.sock";
//!     let channel = Endpoint::try_from("http://[::]")
//!         .unwrap()
//!         .connect_with_connector(service_fn(move |_: Uri| UnixStream::connect(path)))
//!         .await
//!         .expect("Could not create client.");
//!
//!     let mut client = RuntimeServiceClient::new(channel);
//! }
//! ```

pub mod v1 {
    //! API version v1, [original Protocol Buffers file](https://github.com/kubernetes/cri-api/tree/7d8ade91836419c9dd49d059bda1fe4a7dc283f5/pkg/apis/runtime/v1/api.proto).
    tonic::include_proto!("runtime.v1");
}

pub mod v1alpha2 {
    //! API version v1alpha2, [original Protocol Buffers file](https://github.com/kubernetes/cri-api/tree/7d8ade91836419c9dd49d059bda1fe4a7dc283f5/pkg/apis/runtime/v1alpha2/api.proto).
    tonic::include_proto!("runtime.v1alpha2");
}