Architecture Overview
odirscan is currently a single-process application with a clear separation of concerns across packages. The architecture is designed for future evolution toward a distributed system.
Data Flow
Component Responsibilities
| Component | Package | Role |
|---|---|---|
| Scanner | internal | Crawls directory listings and tags findings with HTTP metadata |
| Mullvad | internal/mullvad | Manages relay list, proxy selection, and VPN connectivity checks |
| Config | config | Holds all configuration structs with default constructors |
| Messages | messages | Defines the request/response types exchanged between components |
| Model | model | Data types for scan findings and results |
| Web | web | HTTP server with embedded SPA for browsing results |
Design Decisions
- colly for crawling -- Provides async collection, proxy switching, and request throttling out of the box.
- Actor-like messages --
ScanRequestMessage,ScanResultMessage, andScanFindingMessagedecouple the caller from the scanner implementation, preparing for future RPC boundaries. - Embedded web UI -- The HTML dashboard is compiled into the binary via
go:embed, eliminating runtime file dependencies.