providers

package
v0.0.0-...-02c76fb Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 13 Imported by: 3

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

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

EdgeGetProperties sets attributes for graph edges, specifically making edges originating from the Root node invisible.

func (RPCProvider) SubgraphMarker

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

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.

Jump to

Keyboard shortcuts

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