Skip to content

Commit

Permalink
Add a build status badge
Browse files Browse the repository at this point in the history
  • Loading branch information
blazzy committed Jul 2, 2024
1 parent ab517a8 commit 884cd7f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Crates.io Version](https://img.shields.io/crates/v/podman-rest-client)](https://crates.io/crates/podman-rest-client)
[![docs.rs](https://docs.rs/podman-rest-client/badge.svg)](https://docs.rs/podman-rest-client)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
[![Build](https://img.shields.io/github/actions/workflow/status/blazzy/podman-rest-client/main.yml?branch=main)](https://github.com/blazzy/podman-rest-client/actions)


<!-- cargo-rdme start -->
Expand All @@ -13,19 +14,24 @@ the podman rest api over ssh to a unix socket and directl to a unix socket. Conn
ssh are commonly necessary on macOs where the container runtime runs in a virtual machine
accessible over ssh.

### Usage

```rust
use podman_rest_client::PodmanRestClient;
use podman_rest_client::guess_configuration;
;

// Setup the default configuration
let config = guess_configuration().await.unwrap();

// Initialize a client
let client = PodmanRestClient::new(config).await.unwrap();

// Fetch a list of container images
let images = client.images_api().image_list_libpod(None,None).await.unwrap();
```

If guess_configuration doesn't work for you you can manually create a config.
`guess_configuration` tries to find the default path to the podman socket depending on the
platform you are on. You can also manually create clients configurations:

```rust
use podman_rest_client::PodmanRestClient;
Expand All @@ -37,7 +43,7 @@ let ssh_client = PodmanRestClient::new(Config {
}).await.unwrap();

let unix_client = PodmanRestClient::new(Config {
uri: "unix://run/user/501/podman/podman.sock".to_string(),
uri: "unix:///run/user/501/podman/podman.sock".to_string(),
identity_file: None,
}).await.unwrap();
```
Expand Down
11 changes: 8 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,26 @@
//! ssh are commonly necessary on macOs where the container runtime runs in a virtual machine
//! accessible over ssh.
//!
//! ## Usage
//!
//! ```no_run
//! # tokio_test::block_on(async {
//! use podman_rest_client::PodmanRestClient;
//! use podman_rest_client::guess_configuration;
//! ;
//!
//! // Setup the default configuration
//! let config = guess_configuration().await.unwrap();
//!
//! // Initialize a client
//! let client = PodmanRestClient::new(config).await.unwrap();
//!
//! // Fetch a list of container images
//! let images = client.images_api().image_list_libpod(None,None).await.unwrap();
//! # })
//! ```
//!
//! If guess_configuration doesn't work for you you can manually create a config.
//! `guess_configuration` tries to find the default path to the podman socket depending on the
//! platform you are on. You can also manually create clients configurations:
//!
//! ```no_run
//! # tokio_test::block_on(async {
Expand All @@ -31,7 +36,7 @@
//! }).await.unwrap();
//!
//! let unix_client = PodmanRestClient::new(Config {
//! uri: "unix://run/user/501/podman/podman.sock".to_string(),
//! uri: "unix:///run/user/501/podman/podman.sock".to_string(),
//! identity_file: None,
//! }).await.unwrap();
//! # })
Expand Down

0 comments on commit 884cd7f

Please sign in to comment.