r2pgl / go-plantuml

Generate plantuml diagrams from go source files or directories

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-plantuml

go-plantuml generates plantuml diagrams from go source files or directories.

Installation

go get -u github.com/bykof/go-plantuml

Please consider that $GOPATH/bin should be on our $PATH.

Usage

Usage:
  go-plantuml [command]

Available Commands:
  generate    Generate a plantuml diagram from given paths
  help        Help about any command

Flags:
  -h, --help     help for go-plantuml
  -t, --toggle   Help message for toggle

Use "go-plantuml [command] --help" for more information about a command.

Example

For example we have to files in the directory testGraph.

// addres.go
package testGraph

type (
	Address struct {
		Street     string
		City       string
		PostalCode string
		Country    string
	}
)

func (address Address) FullAddress(withPostalCode bool) string {
    return ""
}
// user.go
package testGraph

type (
	User struct {
		FirstName      string
		LastName       string
		age            uint8
		Address        Address
		privateAddress Address
	}
)

func (user *User) SetFirstName(firstName string) {}

Then we run go-plantuml generate or go-plantuml generate -d . -o graph.puml.

This will create a graph.puml file and check for .go files inside your current directory.

Which looks like this:

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

Generate plantuml diagrams from go source files or directories

License:MIT License


Languages

Language:Go 100.0%