Message Flow
odirscan uses an actor-like message pattern to decouple the orchestration logic from the scanning implementation. This pattern prepares the codebase for a future distributed architecture where components may communicate over gRPC.
Message Types
Message (interface)
The base Message interface is currently empty. It exists as the root of the message hierarchy.
ScanRequestMessage
Carries a list of URLs to process. Used as input to both Scanner.Scan() and Scanner.Tag().
msg := messages.NewScanRequestMessage(
"https://example.com/files/",
"https://example.com/data/",
)
urls := msg.URLs() // []string
ScanResultMessage
Returned by Scanner.Scan(). Contains the original URLs and a list of discovered file URLs.
result := scanner.Scan(req)
fileURLs := result.Scan_result.Findings // []string
scanErr := result.Error // nil or error
ScanFindingMessage
Returned by Scanner.Tag(). Contains fully populated ScanFinding objects with HTTP metadata.
tagged := scanner.Tag(req)
findings := tagged.Findings // []model.ScanFinding
tagErr := tagged.Error // nil or error