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:
9
types.go
9
types.go
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user