utils

package
v0.0.0-...-13d473d Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Ignorewarnings bool

Ignorewarnings is used to ignore warnings if set to true. Default is false (warnings will be displayed)

View Source
var Verbose bool

Verbose enables verbose mode if set to true

Functions

func ChunkString

func ChunkString(s string, chunkSize int) []string

ChunkString splits a string into chunks of X characters https://stackoverflow.com/a/48479355

func ExportGraphToFile

func ExportGraphToFile(outputPath string, outputFormat string, graph *gographviz.Escape) error

ExportGraphToFile exports Graph to file

func Find

func Find(slice []string, val string) (int, bool)

Find takes a slice and looks for an element in it. If found it will return it's key, otherwise it will return -1 and a bool of false. https://golangcode.com/check-if-element-exists-in-slice/

func InitiateGraph

func InitiateGraph() (*gographviz.Escape, error)

InitiateGraph initializes the graph

func ParseTFfile

func ParseTFfile(configpath string) (*tfconfigs.Module, error)

ParseTFfile loads a file path and returns a TF module

func PrintDiags

func PrintDiags(diags hcl2.Diagnostics)

PrintDiags diaplays warning messages

func PrintError

func PrintError(err error)

PrintError displays errors

func RemoveDuplicateValues

func RemoveDuplicateValues(strSlice []string) []string

RemoveDuplicateValues removes duplicate strings in []string slices Ref: https://www.geeksforgeeks.org/how-to-remove-duplicate-values-from-slice-in-golang/

Types

This section is empty.

Jump to

Keyboard shortcuts

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