How kklibo/hashdeep-compare works
Main Components Overview
a) Core Components (Center):
• Command Parser (command.rs)
• Log Entry Processor (log_entry.rs)
• Log Operations Handler (log_ops.rs)
• Partitioner Module (partitioner/)
b) Subcommand Modules (Branching from Core):
• Hash Command
• Sort Command
• Root Command
• Part Command
Data Flow Representation
• Input flow: File system → Log Files → Command Parser
• Processing flow: Command Parser → Specific Command Handler
• Output flow: Command Handler → File System
Component Details
Command Parser:
┌─────────────────┐
• Command Parser │
• Parse Args │
• Validate Input│
• Route Command │
• ┘
Log Processing:
┌─────────────────┐
• Log Processing │
• Parse Headers │
• Validate Lines│
• Extract Data │
• ┘
Partitioner (Most Complex Component):
┌─────────────────────────┐
• Partitioner │
• ┌───────────────────┐ │
• Match Groups │ │
• ┘ │
• ┌───────────────────┐ │
• Match Pairs │ │
• ┘ │
• ┘
Specific Implementation Details
• Partitioner's matching rules hierarchy
• File validation points
• Warning generation points
• Parallel processing capabilities (if any)
Interface Points
• File System Interface (for reading/writing logs)
• Hashdeep Tool Interface (for hash command)
• User Interface (command line)
Error Handling Paths
• Invalid input detection
• File access errors
• Format validation failures
• Warning generation
The clear separation of concerns between parsing, processing, and output generation
Use a hierarchical layout with:
• Top level: Command interface and parsing
• Middle level: Core processing logic
• Bottom level: File system operations and output generation
• Component boundary types
• Warning/error indicators
This design captures both the high-level architecture and the detailed processing flow while maintaining clarity about the system's primary purpose of comparing Hashdeep log files.