Skip to content

Commit

Permalink
fix: version
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Sep 29, 2024
1 parent 689c6f0 commit a714a1f
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license = "MIT"
name = "remotefs-kube"
readme = "README.md"
repository = "https://github.com/veeso/remotefs-rs-kube"
version = "0.2.0"
version = "0.3.0"

[dependencies]
chrono = "^0.4"
Expand Down
58 changes: 52 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//!
//! ```toml
//! remotefs = "^0.2"
//! remotefs-kube = "^0.2"
//! remotefs-kube = "^0.3"
//! ```
//!
//! these features are supported:
Expand All @@ -21,26 +21,72 @@
//! - `no-log`: disable logging. By default, this library will log via the `log` crate.
//!
//!
//! ### Kube client
//! ### Kube multi pod client
//!
//! Here is a basic usage example, with the `Kube` client, which is very similiar to the `Scp` client.
//! The MultiPod client gives access to all the pods with their own containers in a namespace.
//!
//! This client creates an abstract file system with the following structure
//!
//! - / (root)
//! - pod-a
//! - container-a
//! - / (container-a root)
//! - /bin
//! - /home
//! - ...
//! - container-b
//! - / (container-b root)
//! - ...
//! - pod-b
//! - container-c
//! - / (container-c root)
//! - ...
//!
//! So paths have the following structure: `/pod-name/container-name/path/to/file`.
//!
//! ```rust,ignore
//!
//! // import remotefs trait and client
//! use remotefs::RemoteFs;
//! use remotefs_kube::KubeMultiPodFs;
//! use std::path::Path;
//!
//! let rt = Arc::new(
//! tokio::runtime::Builder::new_current_thread()
//! .enable_all()
//! .build()
//! .unwrap(),
//! );
//! let mut client: KubeMultiPodFs = KubeMultiPodFs::new(&rt);
//!
//! // connect
//! assert!(client.connect().is_ok());
//! // get working directory
//! println!("Wrkdir: {}", client.pwd().ok().unwrap().display());
//! // change working directory
//! assert!(client.change_dir(Path::new("/my-pod/alpine/tmp")).is_ok());
//! // disconnect
//! assert!(client.disconnect().is_ok());
//! ```
//!
//! ### Kube container client
//!
//! Here is a basic usage example, with the `KubeContainerFs` client, which is used to connect and interact with a single container on a certain pod. This client gives the entire access to the container file system.
//!
//! ```rust,ignore
//!
//! // import remotefs trait and client
//! use remotefs::RemoteFs;
//! use remotefs_kube::KubeContainerFs;
//! use std::path::Path;
//! use std::sync::Arc;
//! use tokio::runtime::Runtime;
//!
//! let rt = Arc::new(
//! tokio::runtime::Builder::new_current_thread()
//! .enable_all()
//! .build()
//! .unwrap(),
//! );
//! let mut client: KubeContainerFs = KubeContainerFs::new("my-pod", &rt);
//! let mut client: KubeContainerFs = KubeContainerFs::new("my-pod", "container-name", &rt);
//!
//! // connect
//! assert!(client.connect().is_ok());
Expand Down

0 comments on commit a714a1f

Please sign in to comment.