Documentation ¶
Overview ¶
Package providers contains an implementation of specific Graphviz PrintProviders that can be used for generating graphs. At present it supports a single provider, the ResourceProvider, which provides a PrintProvider for resource Preparers.
Index ¶
- func NewRPCProvider() graphviz.PrintProvider
- type RPCProvider
- func (p RPCProvider) EdgeGetProperties(src graphviz.GraphEntity, dst graphviz.GraphEntity) graphviz.PropertySet
- func (p RPCProvider) SubgraphMarker(e graphviz.GraphEntity) graphviz.SubgraphMarkerKey
- func (p RPCProvider) VertexGetID(e graphviz.GraphEntity) (pp.VisibleRenderable, error)
- func (p RPCProvider) VertexGetLabel(e graphviz.GraphEntity) (pp.VisibleRenderable, error)
- func (p RPCProvider) VertexGetProperties(e graphviz.GraphEntity) graphviz.PropertySet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRPCProvider ¶
func NewRPCProvider() graphviz.PrintProvider
NewRPCProvider is a utility function to return a new RPCProvider
Types ¶
type RPCProvider ¶
type RPCProvider struct { graphviz.GraphIDProvider ShowParams bool }
RPCProvider is the PrintProvider type for Resources
func (RPCProvider) EdgeGetProperties ¶
func (p RPCProvider) EdgeGetProperties(src graphviz.GraphEntity, dst graphviz.GraphEntity) graphviz.PropertySet
EdgeGetProperties sets attributes for graph edges, specifically making edges originating from the Root node invisible.
func (RPCProvider) SubgraphMarker ¶
func (p RPCProvider) SubgraphMarker(e graphviz.GraphEntity) graphviz.SubgraphMarkerKey
SubgraphMarker identifies the start of subgraphs for resources. Specifically, it starts a new subgraph whenever a new 'Module' type resource is encountered.
func (RPCProvider) VertexGetID ¶
func (p RPCProvider) VertexGetID(e graphviz.GraphEntity) (pp.VisibleRenderable, error)
VertexGetID returns the graph ID as the VertexID, possibly maksing it depending on the vertext type and configuration.
func (RPCProvider) VertexGetLabel ¶
func (p RPCProvider) VertexGetLabel(e graphviz.GraphEntity) (pp.VisibleRenderable, error)
VertexGetLabel returns a vertext label based on the type of the resource. The specific generated labels sare:
Templates: Return 'Template' and the file destination Modules: Return 'Module' and the module name Params: Return 'name -> "value"' otherwise: Return 'name'
func (RPCProvider) VertexGetProperties ¶
func (p RPCProvider) VertexGetProperties(e graphviz.GraphEntity) graphviz.PropertySet
VertexGetProperties sets graphviz attributes based on the type of the resource. Specifically, we set the shape to 'component' for Shell preparers and 'tab' for templates, and we set the entire root node to be invisible.