list

package
v0.77.21 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package list provides the ability to list Terragrunt configurations in your codebase via the `terragrunt list` command.

Index

Constants

View Source
const (
	CommandName  = "list"
	CommandAlias = "ls"

	FormatFlagName = "format"

	TreeFlagName  = "tree"
	TreeFlagAlias = "T"

	LongFlagName  = "long"
	LongFlagAlias = "l"

	HiddenFlagName       = "hidden"
	DependenciesFlagName = "dependencies"
	ExternalFlagName     = "external"

	DAGFlagName = "dag"

	QueueConstructAsFlagName  = "queue-construct-as"
	QueueConstructAsFlagAlias = "as"
)
View Source
const (
	// FormatText outputs the discovered configurations in text format.
	FormatText = "text"

	// FormatTree outputs the discovered configurations in tree format.
	FormatTree = "tree"

	// FormatLong outputs the discovered configurations in long format.
	FormatLong = "long"

	// SortAlpha sorts the discovered configurations in alphabetical order.
	SortAlpha = "alpha"

	// SortDAG sorts the discovered configurations in a topological sort order.
	SortDAG = "dag"

	// ModeNormal is the default mode for the list command.
	ModeNormal = "normal"

	// ModeDAG is the mode for the list command that sorts and groups output in DAG order.
	ModeDAG = "dag"
)

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(opts *options.TerragruntOptions) *cli.Command

func NewFlags

func NewFlags(opts *Options, prefix flags.Prefix) cli.Flags

func Run

func Run(ctx context.Context, opts *Options) error

Run runs the list command.

Types

type Colorizer

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

Colorizer is a colorizer for the discovered configurations.

func NewColorizer

func NewColorizer(shouldColor bool) *Colorizer

NewColorizer creates a new Colorizer.

func (*Colorizer) Colorize

func (c *Colorizer) Colorize(config *ListedConfig) string

func (*Colorizer) ColorizeHeading

func (c *Colorizer) ColorizeHeading(dep string) string

func (*Colorizer) ColorizeType

func (c *Colorizer) ColorizeType(t discovery.ConfigType) string

type ListedConfig

type ListedConfig struct {
	Type discovery.ConfigType
	Path string

	Dependencies []*ListedConfig
}

type ListedConfigs

type ListedConfigs []*ListedConfig

func (ListedConfigs) Contains

func (l ListedConfigs) Contains(path string) bool

Contains checks to see if the given path is in the listed configs.

func (ListedConfigs) Get

func (l ListedConfigs) Get(path string) *ListedConfig

Get returns the config with the given path.

type Options

type Options struct {
	*options.TerragruntOptions

	// Format determines the format of the output.
	Format string

	// Mode determines the mode of the list command.
	Mode string

	// QueueConstructAs constructs the queue as if a particular command was run.
	QueueConstructAs string

	// Hidden determines whether to detect hidden directories.
	Hidden bool

	// Dependencies determines whether to include dependencies in the output.
	Dependencies bool

	// External determines whether to include external dependencies in the output.
	External bool

	// Tree determines whether to output in tree format.
	Tree bool

	// Long determines whether the output should be in long format.
	Long bool

	// DAG determines whether to output in DAG format.
	DAG bool
}

func NewOptions

func NewOptions(opts *options.TerragruntOptions) *Options

func (*Options) Validate

func (o *Options) Validate() error

type TreeStyler

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

func NewTreeStyler

func NewTreeStyler(shouldColor bool) *TreeStyler

func (*TreeStyler) Style

func (s *TreeStyler) Style(t *tree.Tree) *tree.Tree

Jump to

Keyboard shortcuts

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