crw_core/lib.rs
1//! Core types, configuration, and error handling for the CRW web scraper.
2//!
3//! This crate provides the foundational building blocks shared across all CRW crates:
4//!
5//! - [`config`] — Layered TOML configuration with environment variable overrides
6//! - [`error`] — Unified error types ([`CrwError`]) and result alias ([`CrwResult`])
7//! - [`types`] — Shared data structures (`ScrapeData`, `FetchResult`, `OutputFormat`, etc.)
8//! - [`url_safety`] — SSRF protection (blocks private IPs, cloud metadata, non-HTTP schemes)
9//!
10//! # Example
11//!
12//! ```rust
13//! use crw_core::{AppConfig, CrwError, CrwResult};
14//!
15//! let config = AppConfig::load().unwrap();
16//! assert!(config.server.port > 0);
17//! ```
18
19pub mod config;
20pub mod error;
21pub mod mcp;
22pub mod types;
23pub mod url_safety;
24
25pub use config::AppConfig;
26pub use error::{CrwError, CrwResult};