component

package
v0.91.5 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package component provides types for representing discovered Terragrunt components.

These include units and stacks.

This package contains only data types and their associated methods, with no discovery logic. It exists separately from the discovery package to allow other packages (like filter) to depend on these types without creating circular dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	Parsed           *config.TerragruntConfig
	DiscoveryContext *DiscoveryContext

	Kind Kind
	Path string

	Reading []string

	External bool
	// contains filtered or unexported fields
}

Component represents a discovered Terragrunt configuration.

func (*Component) AddDependency added in v0.91.3

func (c *Component) AddDependency(dependency *Component)

AddDependency adds a dependency to the Component and vice versa.

Using this method ensure that the dependency graph is properly maintained, making it easier to look up dependents and dependencies on a given component without the entire graph available.

func (*Component) AddDependent added in v0.91.3

func (c *Component) AddDependent(dependent *Component)

AddDependent adds a dependent to the Component and vice versa.

Using this method ensure that the dependency graph is properly maintained, making it easier to look up dependents and dependencies on a given component without the entire graph available.

func (*Component) Dependencies

func (c *Component) Dependencies() Components

Dependencies returns the dependencies of the Component.

func (*Component) Dependents added in v0.91.3

func (c *Component) Dependents() Components

Dependents returns the dependents of the Component.

type Components

type Components []*Component

Components is a list of discovered Terragrunt components.

func (Components) CycleCheck

func (c Components) CycleCheck() (*Component, error)

CycleCheck checks for cycles in the dependency graph. If a cycle is detected, it returns the first Component that is part of the cycle, and an error. If no cycle is detected, it returns nil and nil.

func (Components) Filter

func (c Components) Filter(kind Kind) Components

Filter filters the Components by config type.

func (Components) FilterByPath

func (c Components) FilterByPath(path string) Components

FilterByPath filters the Components by path.

func (Components) Paths

func (c Components) Paths() []string

Paths returns the paths of the Components.

func (Components) RemoveByPath

func (c Components) RemoveByPath(path string) Components

RemoveByPath removes the Component with the given path from the Components.

func (Components) Sort

func (c Components) Sort() Components

Sort sorts the Components by path.

type DiscoveryContext

type DiscoveryContext struct {
	Cmd  string
	Args []string
}

DiscoveryContext is the context in which a Component was discovered.

It's useful to know this information, because it can help us determine how the Component should be run or enqueued later.

type Kind

type Kind string

Kind is the type of Terragrunt component.

const (
	// Unit is a component of kind unit.
	Unit Kind = "unit"
	// Stack is a component of kind stack.
	Stack Kind = "stack"
)

Jump to

Keyboard shortcuts

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