Skip to main content

tonin_plugin/
lib.rs

1//! Minimal Plan API for tonin plugin authors.
2//!
3//! Reads `tonin.toml` and resolves env overlays without pulling in the CLI
4//! dep tree (no clap, tera, include_dir, or codegen machinery).
5//!
6//! # Usage in a plugin's `Cargo.toml`
7//!
8//! ```toml
9//! [dependencies]
10//! tonin-plugin = { version = "0.4", default-features = false }
11//! ```
12//!
13//! # Core pattern
14//!
15//! ```no_run
16//! use std::path::Path;
17//! use tonin_plugin::{Plan, select_env};
18//!
19//! let env  = select_env(None);
20//! let plan = Plan::load_with_env(Path::new("tonin.toml"), &env)?;
21//! println!("deploying {} to {}", plan.name, plan.namespace);
22//! # Ok::<(), tonin_plugin::Error>(())
23//! ```
24
25pub mod plan;
26pub(crate) mod stateful;
27
28// Plan loading + schema types
29pub use plan::{
30    CURRENT_SCHEMA, ClientSpec, Error, Mesh, MethodCacheSpec, Plan, RECOMMENDED_CLI_MIN,
31    SUPPORTED_SCHEMAS, ServiceKind, ServiceRef, WebMode,
32};
33
34// Env resolution + resolved stateful types
35pub use stateful::{
36    CacheEngine, CacheSpec, ConfigEngine, ConfigSpec, DatabaseEngine, DatabaseSpec, EmittedEnv,
37    ExternalStore, MigrationRunOn, MigrationTool, MigrationsSpec, SecretProvider, SecretsSpec,
38    select_env,
39};