rust-extensions/crates/shim-client
Maksym Pavlenko 7b0f47b1ba Pass socket fd to child process
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-17 12:14:57 -08:00
..
examples Pass socket fd to child process 2021-11-17 12:14:57 -08:00
src Rename shim protos crate 2021-11-16 11:07:03 -08:00
vendor Rename shim protos crate 2021-11-16 11:07:03 -08:00
Cargo.toml Rename shim protos crate 2021-11-16 11:07:03 -08:00
README.md Rename shim protos crate 2021-11-16 11:07:03 -08:00
build.rs Rename shim protos crate 2021-11-16 11:07:03 -08:00

README.md

Shim protos

TTRPC bindings for containerd's shim events and interfaces.

Look and feel

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)?;

Example

Have a look on example here.

$ cargo build --example connect
$ sudo ./connect unix:///containerd-shim/shim_socket_path.sock