Skip to content

Commit

Permalink
Merge pull request #19 from blazzy/doc-build
Browse files Browse the repository at this point in the history
Doc build fixes
  • Loading branch information
blazzy authored Aug 19, 2024
2 parents 6876c0f + c8ce603 commit d621a5c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ env:
RUST_BACKTRACE: 1

jobs:
doc-build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@nightly

- name: build docs
run: RUSTDOCFLAGS="--cfg docsrs" cargo doc --all-features

build:
runs-on: ubuntu-24.04
steps:
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,6 @@ v5 = []
v4 = []
uds = []
ssh = ["dep:russh", "dep:russh-keys"]

[package.metadata.docs.rs]
all-features = true
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ podman machine start // Start the machine
On linux you might initialize a client like this

```rust
#[cfg(feature = "v5")]
use podman_rest_client::PodmanRestClient;
use podman_rest_client::Config;

Expand All @@ -70,7 +69,6 @@ let images = client.v5().images().image_list_libpod(None).await.unwrap();
On macOs you might initialize a client like this with an ssh url and identity file

```rust
#[cfg(feature = "v5")]
let client = PodmanRestClient::new(Config {
uri: "ssh://core@127.0.0.1:63169/run/user/501/podman/podman.sock".to_string(),
identity_file: Some("/path/to/identity_file".into()),
Expand All @@ -83,7 +81,6 @@ You can also use `Config::guess()` which tries to find the default path to the p
socket depending on the platform you are on.

```rust
#[cfg(feature = "v5")]
// Setup the default configuration
let config = Config::guess().await.unwrap();

Expand All @@ -100,7 +97,6 @@ If you import the `podman_rest_client::v5::Client` trait you can directly call
functions from a client:

```rust
#[cfg(feature = "v5")]
use podman_rest_client::v5::Client;
client.images().image_list_libpod(None).await;
```
Expand All @@ -109,15 +105,14 @@ You can also use various api traits like `podman_rest_client::v5::apis::Images`
call the individual request functions:

```rust
#[cfg(feature = "v5")]
use podman_rest_client::v5::apis::Images;
client.image_list_libpod(None).await;
```


## Features

The default feature set is ["v5", "uds", "ssh"].
The default feature set is `["v5", "uds", "ssh"]`.

- `ssh`: Support for connecting to a podman through an ssh server.
- `uds`: Support for connecting to podman through a unix domain socket.
Expand Down
13 changes: 7 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
//! Provides an interface for querying the Podman REST API. Most of the interface is generated from
//! the official Podman swagger file. It can connect to the Podman API over ssh to a unix socket
//! and directly to a unix socket. Connections over ssh are commonly necessary on macOs where the
Expand Down Expand Up @@ -43,7 +44,7 @@
//! On linux you might initialize a client like this
//!
//! ```no_run
//! #[cfg(feature = "v5")]
//! # #[cfg(feature = "v5")]
//! # tokio_test::block_on(async {
//! use podman_rest_client::PodmanRestClient;
//! use podman_rest_client::Config;
Expand All @@ -63,7 +64,7 @@
//! On macOs you might initialize a client like this with an ssh url and identity file
//!
//! ```no_run
//! #[cfg(feature = "v5")]
//! # #[cfg(feature = "v5")]
//! # tokio_test::block_on(async {
//! # use podman_rest_client::PodmanRestClient;
//! # use podman_rest_client::Config;
Expand All @@ -80,7 +81,7 @@
//! socket depending on the platform you are on.
//!
//! ```no_run
//! #[cfg(feature = "v5")]
//! # #[cfg(feature = "v5")]
//! # tokio_test::block_on(async {
//! # use podman_rest_client::PodmanRestClient;
//! # use podman_rest_client::Config;
Expand All @@ -101,7 +102,7 @@
//! functions from a client:
//!
//! ```
//! #[cfg(feature = "v5")]
//! # #[cfg(feature = "v5")]
//! # tokio_test::block_on(async {
//! # use podman_rest_client::PodmanRestClient;
//! # use podman_rest_client::Config;
Expand All @@ -117,7 +118,7 @@
//! call the individual request functions:
//!
//! ```
//! #[cfg(feature = "v5")]
//! # #[cfg(feature = "v5")]
//! # tokio_test::block_on(async {
//! # use podman_rest_client::PodmanRestClient;
//! # use podman_rest_client::Config;
Expand All @@ -132,7 +133,7 @@
//!
//! ## Features
//!
//! The default feature set is ["v5", "uds", "ssh"].
//! The default feature set is `["v5", "uds", "ssh"]`.
//!
//! - `ssh`: Support for connecting to a podman through an ssh server.
//! - `uds`: Support for connecting to podman through a unix domain socket.
Expand Down

0 comments on commit d621a5c

Please sign in to comment.