api

package
v0.0.2-test Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HCLParser

type HCLParser struct {
}

func NewHCLParser

func NewHCLParser() *HCLParser

func (HCLParser) CollectHCLFilePaths

func (p HCLParser) CollectHCLFilePaths(baseDir string, paths []string) ([]string, error)

CollectHCLFilePaths returns a list of .if files in the given paths. If a path is a directory, it returns all .if files in the directory. If a path is a file, it returns the file if it has a .tf extension. The baseDir parameter is used as the root directory when constructing the full path of each file.

func (HCLParser) ConcatFiles

func (p HCLParser) ConcatFiles(paths []string) (*hclwrite.File, error)

ConcatFiles concatenates the contents of the given .tf files.

func (HCLParser) MergeFileBlocks

func (p HCLParser) MergeFileBlocks(base *hclwrite.File, overlay *hclwrite.File) (*hclwrite.File, error)

func (HCLParser) ReadHCLFile

func (p HCLParser) ReadHCLFile(filename string) (*hclwrite.File, error)

type Patch

type Patch struct {
	Paths []string `hcl:"paths,attr"`
}

type Resource

type Resource struct {
	Paths []string `hcl:"paths,attr"`
}

type Tfustomize

type Tfustomize struct {
	SyntaxVersion string `hcl:"syntax_version,optional"`
}

type TfustomizeConfig

type TfustomizeConfig struct {
	Tfustomize Tfustomize `hcl:"tfustomize,block"`
	Resources  Resource   `hcl:"resources,block"`
	Patches    Patch      `hcl:"patches,block"`
}

func LoadConfig

func LoadConfig(configPath string) (TfustomizeConfig, error)

Jump to

Keyboard shortcuts

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