internal

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanID added in v1.7.0

func CleanID(id string) string

CleanID removes unnecessary parts from the ID

func CleanLabel added in v1.7.0

func CleanLabel(label string) string

CleanLabel removes unnecessary parts from the label

func ConvertToMermaidFlowchart added in v1.7.0

func ConvertToMermaidFlowchart(graph *gographviz.Graph, direction string, subgraphName string) (string, error)

ConvertToMermaidFlowchart converts a gographviz graph to a Mermaid.js compatible string. It accepts a graph, direction, and an optional subgraph name.

func ExtractProvider added in v1.7.0

func ExtractProvider(label string) string

ExtractProvider extracts the provider for separate subgraph

func ParseTerraform

func ParseTerraform(workingDir, tfPath, planFile string) (*gographviz.Graph, error)

ParseTerraform parses the Terraform plan and returns the generated graph

Types

type Edge added in v1.7.0

type Edge struct {
	From string
	To   string
}

type Graph added in v1.7.0

type Graph struct {
	Nodes   []Node
	Edges   []Edge
	NodeMap map[string]int
}

func TransformGraph added in v1.7.0

func TransformGraph(graph *gographviz.Graph) Graph

TransformGraph transforms the parsed graph into cleaned nodes and edges

type Node added in v1.7.0

type Node struct {
	ID       string
	Label    string
	Count    int
	Provider string
}

Jump to

Keyboard shortcuts

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