tsort

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateFilePath

func ValidateFilePath(path string) error

validateFilePath returns an error if the given path is empty, does not exist, or is a directory.

Types

type Ingestor

type Ingestor struct {
	AllowedTypes  map[string]bool
	AllowedBlocks map[string]bool
}

Ingestor is a struct that contains the logic for parsing Terraform files.

func NewIngestor

func NewIngestor() *Ingestor

Ingestor returns a new Ingestor instance.

func (*Ingestor) CanIngest

func (i *Ingestor) CanIngest(path string) error

CanIngest reads the file at the given path and checks if it is a valid Terraform file based on its extension and contents.

func (*Ingestor) Parse

func (i *Ingestor) Parse(path string, outputPath string, dry bool) error

Parse extracts variable and output blocks from the Terraform file at the given path, sorts them alphabetically by name, and writes the output to the specified file or to stdout.

Jump to

Keyboard shortcuts

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