summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorColvin Wellborn <39858617+colvin@users.noreply.github.com>2019-12-26 22:15:06 -0500
committerDoug Tangren <d.tangren@gmail.com>2019-12-26 22:15:06 -0500
commit3580c29b349585ae7de500ccb510659e9caf1500 (patch)
treefaf62cb787674526ff1125b0929ac61f60fd8016 /examples
parent6e4fe40ff249a158cfac33e840f6103a2478d3e4 (diff)
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).
Diffstat (limited to 'examples')
-rw-r--r--examples/version.rs13
1 files changed, 13 insertions, 0 deletions
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);
+}