parser

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Functions

func Functions(target fs.FS, 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 OptionStopOnHCLError

func OptionStopOnHCLError(stop bool) options.ParserOption

func OptionWithConfigsFS added in v0.4.0

func OptionWithConfigsFS(fsys fs.FS) options.ParserOption

func OptionWithDownloads

func OptionWithDownloads(allowed bool) options.ParserOption

func OptionWithSkipCachedModules added in v0.7.0

func OptionWithSkipCachedModules(b bool) options.ParserOption

func OptionWithTFVarsPaths

func OptionWithTFVarsPaths(paths ...string) options.ParserOption

func OptionWithWorkspaceName

func OptionWithWorkspaceName(workspaceName string) options.ParserOption

Types

type ConfigurableTerraformParser

type ConfigurableTerraformParser interface {
	options.ConfigurableParser
	SetTFVarsPaths(...string)
	SetStopOnHCLError(bool)
	SetWorkspaceName(string)
	SetAllowDownloads(bool)
	SetSkipCachedModules(bool)
	SetConfigsFS(fsys fs.FS)
}

type Metrics

type Metrics struct {
	Timings struct {
		DiskIODuration time.Duration
		ParseDuration  time.Duration
	}
	Counts struct {
		Blocks          int
		Modules         int
		ModuleDownloads int
		Files           int
	}
}

type ModuleDefinition

type ModuleDefinition struct {
	Name       string
	Path       string
	FileSystem fs.FS
	Definition *terraform.Block
	Parser     *Parser
	External   bool
}

type ModuleResolver

type ModuleResolver interface {
	Resolve(context.Context, fs.FS, resolvers.Options) (filesystem fs.FS, prefix string, downloadPath string, applies bool, err error)
}

type Option

type Option func(p ConfigurableTerraformParser)

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(moduleFS fs.FS, moduleSource string, opts ...options.ParserOption) *Parser

New creates a new Parser

func (*Parser) EvaluateAll

func (p *Parser) EvaluateAll(ctx context.Context) (terraform.Modules, cty.Value, error)

func (*Parser) GetFilesystemMap

func (p *Parser) GetFilesystemMap() map[string]fs.FS

func (*Parser) Metrics

func (p *Parser) Metrics() Metrics

func (*Parser) ParseFS

func (p *Parser) ParseFS(ctx context.Context, dir string) error

ParseFS parses a root module, where it exists at the root of the provided filesystem

func (*Parser) ParseFile

func (p *Parser) ParseFile(_ context.Context, fullPath string) error

func (*Parser) SetAllowDownloads

func (p *Parser) SetAllowDownloads(b bool)

func (*Parser) SetConfigsFS added in v0.4.0

func (p *Parser) SetConfigsFS(fsys fs.FS)

func (*Parser) SetDebugWriter

func (p *Parser) SetDebugWriter(writer io.Writer)

func (*Parser) SetSkipCachedModules added in v0.7.0

func (p *Parser) SetSkipCachedModules(b bool)

func (*Parser) SetSkipRequiredCheck

func (p *Parser) SetSkipRequiredCheck(b bool)

func (*Parser) SetStopOnHCLError

func (p *Parser) SetStopOnHCLError(b bool)

func (*Parser) SetTFVarsPaths

func (p *Parser) SetTFVarsPaths(s ...string)

func (*Parser) SetWorkspaceName

func (p *Parser) SetWorkspaceName(s string)

Directories

Path Synopsis
Copied from github.com/hashicorp/terraform/internal/lang/funcs
Copied from github.com/hashicorp/terraform/internal/lang/funcs

Jump to

Keyboard shortcuts

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