How go-structurizr works
masterThe library uses two main components to convert Go code into C4 component diagrams in PlantUML format:
- Scraper: Uses reflection to examine Go structures. It identifies components based on whether they implement the
model.HasInfointerface or match specific registered rules and configurations. - View: Takes the
model.Structureproduced by the Scraper and renders it into PlantUML code. The View handles titles, component styling (colors, shapes), and filtering components via tags.
The typical workflow is: Scrape Go code $\rightarrow$ Produce model.Structure $\rightarrow$ Pass to View $\rightarrow$ Render PlantUML.