From 3580c29b349585ae7de500ccb510659e9caf1500 Mon Sep 17 00:00:00 2001 From: Colvin Wellborn <39858617+colvin@users.noreply.github.com> Date: Thu, 26 Dec 2019 22:15:06 -0500 Subject: Expand rep::Version (#212) * expand the fields of Version Expands `shiplift::rep::Version` to contain fields for the following elements of the `/version` API: - `min_api_version` (`MinAPIVersion`) - `os` (`Os`) - `arch` (`Arch`) - `kernel_version` (`KernelVersion`) - `build_time` (`BuildTime`) Adds a new example program to display version information. * order version fields according to api docs * remove min_api_version For backwards compat with older engines, remove the `min_api_version` field. It was apparently added in API version `1.25.0` (circa 2017). --- examples/version.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 examples/version.rs (limited to 'examples') diff --git a/examples/version.rs b/examples/version.rs new file mode 100644 index 0000000..6125e56 --- /dev/null +++ b/examples/version.rs @@ -0,0 +1,13 @@ +use shiplift::Docker; +use tokio::prelude::Future; + +fn main() { + env_logger::init(); + let docker = Docker::new(); + let fut = docker + .version() + .map(|ver| println!("version -> {:#?}", ver)) + .map_err(|e| eprintln!("Error: {}", e)); + + tokio::run(fut); +} -- cgit v1.2.3