go-package-plantuml

command module
v0.0.0-...-e6d360e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2019 License: MIT Imports: 8 Imported by: 0

README

go-package-plantuml

Environmental configuration

1.Install go environment and configure environment variables

export GOROOT=/opt/golang/go
export PATH=$GOROOT/bin:$PATH
export GOPATH=/opt/gopath

2.Install JDK8 and configure environment variables

export JAVA_HOME=/opt/jdk/jdk1.8.0_161
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

in /etc/profile --> Add the corresponding environment variable to the file and refresh with source /etc/profile

Install required software
yum install graphviz
yum install git
yum install wget
Download and compile the project
go get github.com/ahilbig/go-package-plantuml
Compiling and downloading dependencies

First run automatically downloads dependencies, please wait patiently

cd /opt
cp $GOPATH/src/github.com/maobuji/go-package-plantuml/goplantuml . -rf
cd goplantuml
chmod 775 *.sh
sh install.sh

Run directly using commands

Direct operation can set more parameters, --codedir must be entered, other parameters are optional

./go-package-plantuml --codedir /appdev/gopath/src/github.com/contiv/netplugin \
--gopath /appdev/gopath \
--outputfile  /tmp/result.txt
--ignoredir /appdev/gopath/src/github.com/contiv/netplugin/vendor

Parameter Description
--codedir The code directory to analyze
--gopath GOPATH Environment variable directory
--outputfile Analysis results are saved to this file
--ignoredir No need for code analysis directory(Can not set)
--ignorefile, -if No need for code analysis
--file, -f Include file - all other will be ignored --replacetag, -r Mark and (if file exists replace) UML section with comment containing this tag

if --replacetag or -r is specified the UML will be framed by comments containing this tag.< Subsequent calls of the analysis will replace just this section if present instead of overwriting the file. This can be used for automatically generating UML snippets during CI/CD Pipelines for a project and embedding them into markdown containing other contents e.g. readme.md

The output text of the previous step, convert to svg file

java -jar plantuml.jar /tmp/result.txt -tsvg

gouml Samples in the script, can be directly run by sh gouml.sh

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
demo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL