mockforge_ftp/
lib.rs

1//! # MockForge FTP
2//!
3//! FTP protocol support for MockForge.
4//!
5//! This crate provides FTP-specific functionality for creating mock FTP servers,
6//! including virtual file systems, fixture-driven responses, and file transfer simulation.
7//!
8//! ## Overview
9//!
10//! MockForge FTP enables you to:
11//!
12//! - **Serve FTP servers**: Mock FTP protocol for file transfer testing
13//! - **Virtual file system**: In-memory and template-based file generation
14//! - **Fixture management**: Pre-configured file structures and content
15//! - **Upload handling**: Configurable upload validation and storage
16//! - **Protocol compliance**: Standard FTP commands and responses
17//!
18//! ## Quick Start
19//!
20//! ### Basic FTP Server
21//!
22//! ```rust,no_run
23//! use mockforge_ftp::FtpServer;
24//! use mockforge_core::config::FtpConfig;
25//!
26//! #[tokio::main]
27//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
28//!     let config = FtpConfig::default();
29//!     let server = FtpServer::new(config);
30//!
31//!     server.start().await?;
32//!     Ok(())
33//! }
34//! ```
35//!
36//! ## Key Features
37//!
38//! ### Virtual File System
39//! - In-memory file storage with metadata
40//! - Template-based content generation
41//! - Pattern-based file creation (random, zeros, incremental)
42//!
43//! ### Fixture System
44//! - YAML-based fixture definitions
45//! - Upload rules and validation
46//! - Multiple storage options (memory, file, discard)
47//!
48//! ### FTP Protocol Support
49//! - Standard FTP commands (LIST, RETR, STOR, DELE, etc.)
50//! - Passive and active mode support
51//! - Authentication and anonymous access
52//!
53//! ## Related Crates
54//!
55//! - [`mockforge-core`](https://docs.rs/mockforge-core): Core mocking functionality
56//! - [`libunftp`](https://docs.rs/libunftp): Underlying FTP server library
57
58pub mod commands;
59pub mod fixtures;
60pub mod server;
61pub mod spec_registry;
62pub mod storage;
63pub mod vfs;
64
65// Re-export main types
66pub use fixtures::{FileValidation, FtpFixture, UploadRule, UploadStorage, VirtualFileConfig};
67pub use server::FtpServer;
68pub use spec_registry::FtpSpecRegistry;
69pub use vfs::{FileContent, FileMetadata, GenerationPattern, VirtualFile, VirtualFileSystem};