Crates.io | containerd-shim-client |
lib.rs | containerd-shim-client |
version | 0.1.2 |
source | src |
created_at | 2021-12-10 19:03:33.369397 |
updated_at | 2021-12-30 06:57:09.101789 |
description | TTRPC bindings for containerd shim interfaces |
homepage | https://containerd.io |
repository | https://github.com/containerd/rust-extensions |
max_upload_size | |
id | 495834 |
size | 808,645 |
TTRPC bindings for containerd's shim events and interfaces.
The containerd-shim-client
crate provides Protobuf message
and ttRPC service definitions for the
Containerd shim v2 protocol.
The message and service definitions are auto-generated from protobuf source files under vendor/
by using ttrpc-codegen. So please do not
edit those auto-generated source files. If upgrading/modification is needed, please follow the steps:
cargo build --features=generate_bindings
.Add containerd-shim-client
as a dependency in your Cargo.toml
[dependencies]
containerd-shim-client = "0.1"
Basic client code looks as follows:
let client = client::Client::connect(socket_path)?;
let task_client = client::TaskClient::new(client);
let context = client::ttrpc::context::with_timeout(0);
let req = client::api::ConnectRequest {
id: pid,
..Default::default()
};
let resp = task_client.connect(context, &req)?;
The way to build the ttRPC client connect example:
$ cargo build --example connect
$ sudo ./connect unix:///containerd-shim/shim_socket_path.sock