helm-rs 0.1.2

Typed Rust API for Helm 4: swappable backends, native chart, values and release reading
Documentation
//! Typed Rust API for [Helm](https://helm.sh) 4.
//!
//! helm-rs drives Helm; it never reimplements Helm's engine. Everything Helm defines by a file
//! format or data (charts, values, schemas, release records, rendered manifests) is read natively
//! in Rust. Everything defined by Helm's behaviour (rendering, coalescing values, dependencies,
//! hooks, install, upgrade, wait) goes through a [`Backend`].
//!
//! The backend is a type parameter of [`Helm`], chosen statically; each backend sits behind its
//! own Cargo feature:
//!
//! - `cli` (default): [`cli::Cli`] runs the `helm` binary, Helm 4 only.
//! - `mock`: [`mock::Mock`], a scriptable backend for tests.
//! - `kube`: native reads that need a cluster connection ([`release::store`]).

//!
//! See [`cli::Cli`] for a `no_run` example against a real Helm and [`mock::Mock`] for a
//! runnable one.
//!
//! # Building commands
//!
//! Every command in [`command`] has a builder derived with [`bon`](https://bon-rs.com). The
//! arguments Helm requires go to `builder(...)`, so leaving one out does not compile; each flag
//! is a setter, with `maybe_<flag>` taking an `Option` and `&str` accepted wherever a `String` or
//! a path is stored. Repeated flags have a setter for the whole list and one for a single item.
//! `Command::new(...)` is the same command with every flag left to Helm.
//!
//! ```no_run
//! # async fn demo() -> helm_rs::Result<()> {
//! use std::time::Duration;
//!
//! use helm_rs::command::{ChartPathOptions, ChartRef, Install, ReleaseName, WaitStrategy};
//! use helm_rs::{Helm, Values};
//!
//! let helm = Helm::detect().await?.with_namespace("prod");
//! let install = Install::builder(
//!     ReleaseName::Named("web".to_owned()),
//!     ChartRef::Repo("charts/web".to_owned()),
//! )
//! .chart_path(ChartPathOptions::builder().version("^2.0.0").build())
//! .values(Values::new().set("replicas", 3))
//! .create_namespace(true)
//! .label("team", "web")
//! .wait(WaitStrategy::Watcher)
//! .timeout(Duration::from_secs(300))
//! .build();
//! let release = helm.run(install).await?;
//!
//! println!("{}", release.name);
//! # Ok(()) }
//! ```
//!
//! # Loading charts
//!
//! [`Chart::fetch`] loads a chart from wherever it lives: a path natively, a repository, URL or
//! `oci://` chart through `helm pull` into a temporary directory that is removed afterwards.
//!
//! ```no_run
//! # async fn demo() -> helm_rs::Result<()> {
//! use helm_rs::command::{ChartPathOptions, ChartRef};
//! use helm_rs::{Chart, Helm};
//!
//! let helm = Helm::detect().await?;
//! let options = ChartPathOptions::builder().version("1.2.3").build();
//! let chart = Chart::fetch(&helm, &ChartRef::Repo("charts/web".into()), &options).await?;
//!
//! println!("{}", chart.name());
//! # Ok(()) }
//! ```

mod error;
mod go_json;

pub mod backend;
pub mod chart;
pub mod command;
pub mod helm;
pub mod manifest;
pub mod options;
pub mod release;
pub mod repo;
pub mod schema;
pub mod values;
pub mod version;

#[cfg(feature = "cli")]
pub mod cli;
#[cfg(feature = "mock")]
pub mod mock;

pub use backend::{Backend, Command, Execute};
pub use chart::Chart;
#[cfg(feature = "cli")]
pub use cli::Cli;
pub use error::{Error, Result};
pub use helm::Helm;
pub use manifest::Manifest;
pub use options::{GlobalOptions, Secret};
pub use release::Release;
pub use values::Values;