parser

package
v0.61.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountFiles

func CountFiles() int

func Functions

func Functions(baseDir string) map[string]function.Function

Functions returns the set of functions that should be used to when evaluating expressions in the receiving scope.

func LoadBlocksFromFile

func LoadBlocksFromFile(file *hcl.File) (hcl.Blocks, error)

func LoadDirectory

func LoadDirectory(fullPath string, stopOnHCLError bool) ([]*hcl.File, error)

func LoadTFVars

func LoadTFVars(filenames []string) (map[string]cty.Value, error)

Types

type Evaluator

type Evaluator struct {
	// contains filtered or unexported fields
}

func NewEvaluator

func NewEvaluator(
	projectRootPath string,
	modulePath string,
	workingDir string,
	blocks block.Blocks,
	inputVars map[string]cty.Value,
	moduleMetadata *ModulesMetadata,
	visitedModules []*visitedModule,
	stopOnHCLError bool,
	workspace string,
) *Evaluator

func (*Evaluator) EvaluateAll

func (e *Evaluator) EvaluateAll() ([]block.Module, error)

func (*Evaluator) ExportOutputs

func (e *Evaluator) ExportOutputs() cty.Value

export module outputs to a parent

type ModuleDefinition added in v0.58.2

type ModuleDefinition struct {
	Name       string
	Path       string
	Definition block.Block
	Modules    []block.Module
}

type ModuleMetadata

type ModuleMetadata struct {
	Key     string `json:"Key"`
	Source  string `json:"Source"`
	Version string `json:"Version"`
	Dir     string `json:"Dir"`
}

type ModulesMetadata

type ModulesMetadata struct {
	Modules []ModuleMetadata `json:"Modules"`
}

func LoadModuleMetadata

func LoadModuleMetadata(fullPath string) (*ModulesMetadata, error)

type Option

type Option func(p *Parser)

func OptionDoNotSearchTfFiles

func OptionDoNotSearchTfFiles() Option

func OptionSkipDownloaded added in v0.58.13

func OptionSkipDownloaded() Option

func OptionStopOnHCLError

func OptionStopOnHCLError() Option

func OptionWithTFVarsPaths

func OptionWithTFVarsPaths(paths []string) Option

func OptionWithWorkspaceName added in v0.50.4

func OptionWithWorkspaceName(workspaceName string) Option

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser is a tool for parsing terraform templates at a given file system location

func New

func New(initialPath string, options ...Option) *Parser

New creates a new Parser

func (*Parser) ParseDirectory

func (parser *Parser) ParseDirectory() ([]block.Module, error)

ParseDirectory parses all terraform files within a given directory

Jump to

Keyboard shortcuts

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