1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! # ironflow-runtime
//!
//! The daemon/server layer for **ironflow**, providing webhook HTTP endpoints and
//! cron scheduling on top of [`ironflow_core`] operations.
//!
//! This crate exposes a [`runtime::Runtime`] builder that lets you declaratively register
//! webhook routes (with pluggable authentication) and cron jobs, then either start a
//! full [Axum](https://docs.rs/axum) HTTP server via [`runtime::Runtime::serve`] or run
//! only the cron scheduler via [`runtime::Runtime::run_crons`], both with graceful
//! shutdown support.
//!
//! # Quick start
//!
//! ```no_run
//! use ironflow_runtime::prelude::*;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! Runtime::new()
//! .webhook("/hooks/github", WebhookAuth::github("my-secret"), |payload| async move {
//! println!("received: {payload}");
//! })
//! .cron("0 */5 * * * *", "health-check", || async {
//! println!("running health check");
//! })
//! .serve("0.0.0.0:3000")
//! .await?;
//!
//! Ok(())
//! }
//! ```
//!
//! # Modules
//!
//! - [`runtime`] - The [`runtime::Runtime`] builder and HTTP server.
//! - [`webhook`] - Webhook authentication strategies ([`webhook::WebhookAuth`]).
//! - `cron` - Internal cron job representation (crate-private).
pub
/// Convenience re-exports for common usage.
///
/// # Contents
///
/// - [`Runtime`](crate::runtime::Runtime) - The server builder.
/// - [`WebhookAuth`](crate::webhook::WebhookAuth) - Webhook authentication configuration.