config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package config loads and validates the HCL policy file (.tfstackplan.hcl), resolving classification presets+rules into a single ordered rule list while preserving source declaration order.

Index

Constants

View Source
const DefaultFilename = ".tfstackplan.hcl"

DefaultFilename is auto-discovered in the working directory.

Variables

This section is empty.

Functions

func Discover

func Discover(dir string) (string, bool)

Discover returns the config path if DefaultFilename exists under dir.

Types

type Classification

type Classification struct {
	Default model.Class
	Rules   []classify.Rule
}

Classification holds the resolved, ordered rules and the fallback class.

type Config

type Config struct {
	Classification *Classification // nil when no classification block present
	Diff           DiffConfig
	Links          *LinksConfig // nil when no links block present
}

Config is the parsed policy file.

func Load

func Load(path string) (*Config, error)

Load parses and validates the HCL file at path.

type DiffConfig

type DiffConfig struct {
	Detect            bool
	MaxAttributeLines int // 0 = no cap
	Overrides         []DiffOverride
}

DiffConfig holds diff defaults and per-attribute overrides.

func (DiffConfig) Resolve

func (d DiffConfig) Resolve(resourceType, attr string) string

Resolve returns the differ kind ("" = auto) for a resource type + attribute.

type DiffOverride

type DiffOverride struct {
	TypePattern *regexp.Regexp
	Attribute   string
	Differ      string
}

DiffOverride forces a differ for a (resource type, attribute) pair.

type HeaderLink struct {
	Label string
	URL   string
}

HeaderLink is one templated report-header link.

type LinksConfig added in v0.3.0

type LinksConfig struct {
	Resource string
	Stack    string
	Header   []HeaderLink
}

LinksConfig holds URL templates for header / stack / resource links.

Jump to

Keyboard shortcuts

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