config

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileName = ".tfr-static.hcl"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	OutputDir             string
	BaseURL               string
	RepoPath              string
	MainBranch            string
	ModulesPath           string
	HTML                  bool
	HTMLIndex             string
	Gzip                  bool
	TerraformDocs         bool
	InvalidationFile      string
	InvalidationFormat    string
	InvalidationFullURL   bool
	InvalidationBaseURL   string
	InvalidationURLEncode bool
	InvalidationDirs      bool
	HTMLBase              string
	Namespace             string
	RepositoryURL         string
	RepositoryPrefix      string
	RepositoryRef         string
	RepositoryTagPrefix   string
	ModuleMappings        map[string]string
}

Config holds the resolved configuration for tfr-static.

type FileConfig

type FileConfig struct {
	BaseURL               *string       `hcl:"base_url,optional"`
	MainBranch            *string       `hcl:"main_branch,optional"`
	OutputDir             *string       `hcl:"output_dir,optional"`
	ModulesPath           *string       `hcl:"modules_path,optional"`
	HTML                  *bool         `hcl:"html,optional"`
	HTMLIndex             *string       `hcl:"html_index,optional"`
	Gzip                  *bool         `hcl:"gzip,optional"`
	TerraformDocs         *bool         `hcl:"terraform_docs,optional"`
	InvalidationFile      *string       `hcl:"invalidation_file,optional"`
	InvalidationFormat    *string       `hcl:"invalidation_format,optional"`
	InvalidationFullURL   *bool         `hcl:"invalidation_full_url,optional"`
	InvalidationBaseURL   *string       `hcl:"invalidation_base_url,optional"`
	InvalidationURLEncode *bool         `hcl:"invalidation_url_encode,optional"`
	InvalidationDirs      *bool         `hcl:"invalidation_dirs,optional"`
	HTMLBase              *string       `hcl:"html_base,optional"`
	Namespace             *string       `hcl:"namespace,optional"`
	RepositoryURL         *string       `hcl:"repository_url,optional"`
	RepositoryPrefix      *string       `hcl:"repository_prefix,optional"`
	RepositoryRef         *string       `hcl:"repository_ref,optional"`
	RepositoryTagPrefix   *string       `hcl:"repository_tag_prefix,optional"`
	Modules               []ModuleBlock `hcl:"module,block"`
}

FileConfig represents the HCL config file structure.

func LoadFileConfig

func LoadFileConfig(dir string) (*FileConfig, error)

LoadFileConfig reads the .tfr-static.hcl config file from the given directory. Returns nil (no error) if the file does not exist.

type ModuleBlock added in v0.2.0

type ModuleBlock struct {
	DirPath      string `hcl:"dir_path,label"`
	RegistryPath string `hcl:"registry_path"`
}

ModuleBlock maps a directory path to a custom 3-segment registry path.

Jump to

Keyboard shortcuts

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