Skip to main content

apimock_config/
lib.rs

1//! Configuration model for apimock.
2//!
3//! # Responsibilities
4//!
5//! - Read `apimock.toml` and every file it references.
6//! - Resolve relative paths against the config file's parent directory.
7//! - Validate that paths exist, rules are consistent, etc.
8//! - (Stage 2) apply structured edit commands from a GUI, and save the
9//!   result back to disk preserving structure as much as possible.
10//!
11//! # What is deliberately *not* here
12//!
13//! - Compiling Rhai middlewares — that's `apimock-server`'s job. This
14//!   crate only records the paths listed under `service.middlewares`.
15//! - HTTP response construction. Fully in `apimock-server`.
16//! - Rule-set parsing. Delegated to `apimock-routing::RuleSet::new`.
17//!
18//! # Stage-1 surface
19//!
20//! The `view` module defines the stage-1 GUI-facing API shape
21//! ([`WorkspaceSnapshot`] etc.). In 5.0.0 these types carry their
22//! definition and rustdoc but no populating logic; the stage-2 work
23//! fills in construction + edit / save behaviour.
24
25pub mod config;
26pub mod error;
27pub mod path_util;
28pub mod view;
29
30pub use config::{
31    Config,
32    constant::{LISTENER_DEFAULT_IP_ADDRESS, LISTENER_DEFAULT_PORT},
33    listener_config::ListenerConfig,
34    log_config::LogConfig,
35    service_config::ServiceConfig,
36};
37pub use error::{ConfigError, ConfigResult};
38pub use view::{
39    ApplyResult, ConfigFileView, ConfigNodeView, Diagnostic, DiagnosticSeverity, EditCommand,
40    EditTarget, EditValue, NodeKind, ReloadHint, SaveResult, WorkspaceSnapshot,
41};