parser

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package parser provides HCL parsing functionality for Terraform files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DependencyExtractor

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

DependencyExtractor extracts module dependencies from parsed Terraform files.

func NewDependencyExtractor

func NewDependencyExtractor(parser ModuleParser, index *discovery.ModuleIndex) *DependencyExtractor

NewDependencyExtractor creates a new dependency extractor.

func (*DependencyExtractor) ExtractAllDependencies

func (de *DependencyExtractor) ExtractAllDependencies(ctx context.Context) (map[string]*ModuleDependencies, []error)

ExtractAllDependencies extracts dependencies for all modules in the index.

func (*DependencyExtractor) ExtractDependencies

func (de *DependencyExtractor) ExtractDependencies(ctx context.Context, module *discovery.Module) (*ModuleDependencies, error)

ExtractDependencies extracts dependencies for a single module.

type LibraryDependency

type LibraryDependency = parsermodel.LibraryDependency

Re-exports of the shared parser model under the public parser package. Aliases are kept only for types with at least one external caller; the authoritative declarations live in pkg/parser/model.

type LockedProvider added in v0.8.0

type LockedProvider = parsermodel.LockedProvider

Re-exports of the shared parser model under the public parser package. Aliases are kept only for types with at least one external caller; the authoritative declarations live in pkg/parser/model.

type ModuleCall

type ModuleCall = parsermodel.ModuleCall

Re-exports of the shared parser model under the public parser package. Aliases are kept only for types with at least one external caller; the authoritative declarations live in pkg/parser/model.

type ModuleDependencies

type ModuleDependencies = parsermodel.ModuleDependencies

Re-exports of the shared parser model under the public parser package. Aliases are kept only for types with at least one external caller; the authoritative declarations live in pkg/parser/model.

type ModuleParser

type ModuleParser interface {
	ParseModule(ctx context.Context, modulePath string) (*ParsedModule, error)
	ResolveWorkspacePath(ref *RemoteStateRef, modulePath string, locals, variables map[string]cty.Value) ([]string, error)
}

ModuleParser is the interface for parsing Terraform modules.

type ParsedModule

type ParsedModule = parsermodel.ParsedModule

Re-exports of the shared parser model under the public parser package. Aliases are kept only for types with at least one external caller; the authoritative declarations live in pkg/parser/model.

type Parser

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

Parser handles parsing of Terraform HCL files.

func NewParser

func NewParser(segments []string) *Parser

NewParser creates a new HCL parser with the given pattern segments.

func (*Parser) ParseModule

func (p *Parser) ParseModule(ctx context.Context, modulePath string) (*ParsedModule, error)

ParseModule parses all Terraform files in a module directory.

func (*Parser) ResolveWorkspacePath

func (p *Parser) ResolveWorkspacePath(ref *RemoteStateRef, modulePath string, locals, variables map[string]cty.Value) ([]string, error)

ResolveWorkspacePath resolves workspace paths from a remote state config using the module's locals, variables, and path-derived segment values.

func (*Parser) Segments

func (p *Parser) Segments() []string

Segments returns the parser's configured pattern segments.

type RemoteStateRef

type RemoteStateRef = parsermodel.RemoteStateRef

Re-exports of the shared parser model under the public parser package. Aliases are kept only for types with at least one external caller; the authoritative declarations live in pkg/parser/model.

type RequiredProvider added in v0.8.0

type RequiredProvider = parsermodel.RequiredProvider

Re-exports of the shared parser model under the public parser package. Aliases are kept only for types with at least one external caller; the authoritative declarations live in pkg/parser/model.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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