Skip to content
This repository has been archived by the owner on Apr 22, 2022. It is now read-only.

Commit

Permalink
Fix documentation quick-start example
Browse files Browse the repository at this point in the history
  • Loading branch information
passcod committed Apr 10, 2021
1 parent 7e1c5b0 commit 8fb052a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,26 @@
//! # Quick start
//!
//! ```no_run
//! use cni_plugin::{Cni, install_logger};
//! install_logger("hello-world.log");
//! use cni_plugin::{Cni, logger};
//! logger::install(env!("CARGO_PKG_NAME"));
//! match Cni::load() {
//! Cni::Add { container_id, ifname, netns, path, config } => {}
//! Cni::Del { container_id, ifname, netns, path, config } => {}
//! Cni::Check { container_id, ifname, netns, path, config } => {}
//! Cni::Version(_) => unreachable!()
//! }
//! ```
//!
//! or:
//!
//! ```no_run
//! use cni_plugin::{Cni, Inputs, logger};
//! logger::install(env!("CARGO_PKG_NAME"));
//!
//! let Inputs {
//! command, container_id, ifname, netns, path, config
//! } = match Cni::load().into_inputs().unwrap();
//! ```
pub use cni::Cni;
pub use command::Command;
Expand Down

0 comments on commit 8fb052a

Please sign in to comment.