jfeliu007 / Goplantuml
Licence: mit
PlantUML Class Diagram Generator for golang projects
Stars: ✭ 352
Projects that are alternatives of or similar to Goplantuml
Go Plantuml
Generate plantuml diagrams from go source files or directories
Stars: ✭ 167 (-52.56%)
Mutual labels: plantuml, diagram
Azure Plantuml
PlantUML sprites, macros, and other includes for Azure services
Stars: ✭ 247 (-29.83%)
Mutual labels: plantuml, diagram
Jekyll Spaceship
🚀 A Jekyll plugin to provide powerful supports for table, mathjax, plantuml, mermaid, emoji, video, audio, youtube, vimeo, dailymotion, soundcloud, spotify, etc.
Stars: ✭ 196 (-44.32%)
Mutual labels: plantuml, diagram
Arkit
JavaScript architecture diagrams and dependency graphs
Stars: ✭ 671 (+90.63%)
Mutual labels: plantuml, diagram
PlantUml-Language-Service
PlantUml Language Service extension for Visual Studio 2017 and 2019
Stars: ✭ 24 (-93.18%)
Mutual labels: diagram, plantuml
Umldoclet
Automatically generate PlantUML diagrams in javadoc
Stars: ✭ 138 (-60.8%)
Mutual labels: plantuml, diagram
Plantuml Icon Font Sprites
plantuml-font-icon-sprites
Stars: ✭ 242 (-31.25%)
Mutual labels: plantuml, diagram
Asciidoctor Kroki
Asciidoctor.js extension to convert diagrams to images using Kroki!
Stars: ✭ 55 (-84.37%)
Mutual labels: plantuml, diagram
plantuml2mysql
This utility parses PlantUML class diagram and generates SQL DDL for MySQL
Stars: ✭ 110 (-68.75%)
Mutual labels: diagram, plantuml
Aws Plantuml
PlantUML sprites, macros, and other includes for AWS components.
Stars: ✭ 565 (+60.51%)
Mutual labels: plantuml, diagram
plantuml-libs
A set of PlantUML libraries and a NPM cli tool to design diagrams which focus on several technologies/approaches: Amazon Web Services (AWS), Azure, Google Cloud Platform (GCP), C4 Model or even EventStorming and more.
Stars: ✭ 75 (-78.69%)
Mutual labels: diagram, plantuml
C4 Plantuml
C4-PlantUML combines the benefits of PlantUML and the C4 model for providing a simple way of describing and communicate software architectures
Stars: ✭ 3,522 (+900.57%)
Mutual labels: plantuml, diagram
C4-PlantumlSkin
This library provides skinning to create C4 diagrams using PlantUml
Stars: ✭ 74 (-78.98%)
Mutual labels: diagram, plantuml
erdiagram
Entity-Relationship diagram code generator library
Stars: ✭ 28 (-92.05%)
Mutual labels: diagram, plantuml
idle
parse source code(objective-c, java) generate uml(class diagram)
Stars: ✭ 44 (-87.5%)
Mutual labels: diagram, plantuml
plantuml2ddl
Intellij IDEA plugin- MySQL DDL and PlantUML convert to each other.
Stars: ✭ 23 (-93.47%)
Mutual labels: plantuml
Markdown Preview Enhanced
One of the 'BEST' markdown preview extensions for Atom editor!
Stars: ✭ 3,478 (+888.07%)
Mutual labels: plantuml
pinout
An open source Python package that generates hardware pinout diagrams as SVG images.
Stars: ✭ 298 (-15.34%)
Mutual labels: diagram
SCView
Simple Express-G Viewer. Tiny implementation. Based on STEPCode
Stars: ✭ 35 (-90.06%)
Mutual labels: diagram
GoPlantUML
PlantUML Class Diagram Generator for golang projects. Generates class diagram text compatible with plantuml with the information of all structures and interfaces as well as the relationship among them.
Want to try it on your code?
Take a look at www.dumels.com. We have created dumels using this library.
Code of Conduct
Please, review the code of conduct here.
Prerequisites
golang 1.10 or above
Installing
go get github.com/jfeliu007/goplantuml/parser
go get github.com/jfeliu007/goplantuml/cmd/goplantuml
cd $GOPATH/src/github.com/jfeliu007/goplantuml
go install ./...
This will install the command goplantuml in your GOPATH bin folder.
Usage
goplantuml [-recursive] path/to/gofiles path/to/gofiles2
goplantuml [-recursive] path/to/gofiles path/to/gofiles2 > diagram_file_name.puml
Usage of goplantuml:
-aggregate-private-members
Show aggregations for private members. Ignored if -show-aggregations is not used.
-hide-connections
hides all connections in the diagram
-hide-fields
hides fields
-hide-methods
hides methods
-ignore string
comma separated list of folders to ignore
-notes string
Comma separated list of notes to be added to the diagram
-output string
output file path. If omitted, then this will default to standard output
-recursive
walk all directories recursively
-show-aggregations
renders public aggregations even when -hide-connections is used (do not render by default)
-show-aliases
Shows aliases even when -hide-connections is used
-show-compositions
Shows compositions even when -hide-connections is used
-show-connection-labels
Shows labels in the connections to identify the connections types (e.g. extends, implements, aggregates, alias of
-show-implementations
Shows implementations even when -hide-connections is used
-show-options-as-note
Show a note in the diagram with the none evident options ran with this CLI
-title string
Title of the generated diagram
Example
goplantuml $GOPATH/src/github.com/jfeliu007/goplantuml/parser
// echoes
@startuml
namespace parser {
class Struct {
+ Functions []*Function
+ Fields []*Parameter
+ Type string
+ Composition []string
+ Extends []string
}
class LineStringBuilder {
+ WriteLineWithDepth(depth int, str string)
}
class ClassParser {
- structure <font color=blue>map</font>[string]<font color=blue>map</font>[string]*Struct
- currentPackageName string
- allInterfaces <font color=blue>map</font>[string]<font color=blue>struct</font>{}
- allStructs <font color=blue>map</font>[string]<font color=blue>struct</font>{}
- structImplementsInterface(st *Struct, inter *Struct)
- parsePackage(node ast.Node)
- parseFileDeclarations(node ast.Decl)
- addMethodToStruct(s *Struct, method *ast.Field)
- getFunction(f *ast.FuncType, name string)
- addFieldToStruct(s *Struct, field *ast.Field)
- addToComposition(s *Struct, fType string)
- addToExtends(s *Struct, fType string)
- getOrCreateStruct(name string)
- getStruct(structName string)
- getFieldType(exp ast.Expr, includePackageName bool)
+ Render()
}
class Parameter {
+ Name string
+ Type string
}
class Function {
+ Name string
+ Parameters []*Parameter
+ ReturnValues []string
}
}
strings.Builder *-- parser.LineStringBuilder
@enduml
goplantuml $GOPATH/src/github.com/jfeliu007/goplantuml/parser > ClassDiagram.puml
// Generates a file ClassDiagram.plum with the previous specifications
There are two different relationships considered in goplantuml:
- Interface implementation
- Type Composition
The following example contains interface implementations and composition. Notice how the signature of the functions
package testingsupport
//MyInterface only has one method, notice the signature return value
type MyInterface interface {
foo() bool
}
//MyStruct1 will implement the foo() bool function so it will have an "extends" association with MyInterface
type MyStruct1 struct {
}
func (s1 *MyStruct1) foo() bool {
return true
}
//MyStruct2 will be directly composed of MyStruct1 so it will have a composition relationship with it
type MyStruct2 struct {
MyStruct1
}
//MyStruct3 will have a foo() function but the return value is not a bool, so it will not have any relationship with MyInterface
type MyStruct3 struct {
Foo MyStruct1
}
func (s3 *MyStruct3) foo() {
}
This will be generated from the previous code
@startuml
namespace testingsupport {
interface MyInterface {
- foo() bool
}
class MyStruct1 << (S,Aquamarine) >> {
- foo() bool
}
class MyStruct2 << (S,Aquamarine) >> {
}
class MyStruct3 << (S,Aquamarine) >> {
- foo()
+ Foo MyStruct1
}
}
testingsupport.MyStruct1 *-- testingsupport.MyStruct2
testingsupport.MyInterface <|-- testingsupport.MyStruct1
testingsupport.MyStruct3 o-- testingsupport.MyStruct1
@enduml
www.dumels.com
Diagram usingNote that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].