Add graphviz generation and visualization

This requires graphviz to be installed on your machine. If you run the
command with sudo, it will create the files with the original user
ownership to make it easier to remove them without root.
This commit is contained in:
James Shubin
2015-12-29 01:04:03 -05:00
parent 6b4fa21074
commit 1ba6be2957
5 changed files with 126 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ import (
type Type interface {
Init()
GetName() string // can't be named "Name()" because of struct field
GetType() string
Watch()
StateOK() bool // TODO: can we rename this to something better?
Apply() bool
@@ -71,6 +72,10 @@ func (obj *BaseType) GetName() string {
return obj.Name
}
func (obj *BaseType) GetType() string {
return "Base"
}
func (obj *BaseType) GetVertex() *Vertex {
return obj.vertex
}
@@ -198,6 +203,10 @@ func (obj *BaseType) Process(typ Type) {
}
func (obj *NoopType) GetType() string {
return "Noop"
}
func (obj *NoopType) Watch() {
//vertex := obj.vertex // stored with SetVertex
var send = false // send event?