list

package
v1.170.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// KeyTerraform is the key for terraform components.
	KeyTerraform = "terraform"
	// KeySettings is the key for settings section.
	KeySettings = "settings"
	// KeyMetadata is the key for metadata section.
	KeyMetadata = "metadata"
	// KeyComponents is the key for components section.
	KeyComponents = "components"
	// KeyVars is the key for vars section in components.
	KeyVars = "vars"
	// KeyAbstract is the key for abstract flag in components.
	KeyAbstract = "abstract"
	// KeyStack is the key used in log messages to identify stack contexts.
	KeyStack = "stack"
	// KeyComponent is the key used to identify component in log messages and errors.
	KeyComponent = "component"
	// DotChar is the dot character used in queries.
	DotChar = "."
	// LeftBracketChar is the left bracket character used in array indices.
	LeftBracketChar = "["
	// KeyValue is the key used for scalar values in result maps.
	KeyValue = "value"
	// KeyQuery is the key used for query information in log messages and errors.
	KeyQuery = "query"
	// TypeFormatSpec is the format specifier used to print variable types.
	TypeFormatSpec = "%T"
	// KeyPattern is the key used in log messages for pattern matching contexts.
	KeyPattern = "pattern"
)

Component and section name constants.

View Source
const (
	FormatTable = "table"
	FormatJSON  = "json"
	FormatYAML  = "yaml"
	FormatCSV   = "csv"
	FormatTSV   = "tsv"
)
View Source
const DefaultMaxColumns = 10

DefaultMaxColumns is the default maximum number of columns to display.

Variables

View Source
var (
	// ErrParseStacks is returned when stack data cannot be parsed.
	ErrParseStacks = errors.New("could not parse stacks")
	// ErrParseComponents is returned when component data cannot be parsed.
	ErrParseComponents = errors.New("could not parse components")
	// ErrParseTerraformComponents is returned when terraform component data cannot be parsed.
	ErrParseTerraformComponents = errors.New("could not parse Terraform components")
	// ErrStackNotFound is returned when a requested stack is not found.
	ErrStackNotFound = errors.New("stack not found")
	// ErrProcessStack is returned when there's an error processing a stack.
	ErrProcessStack = errors.New("error processing stack")
)

Error definitions for component listing.

View Source
var (
	ErrInvalidStackPattern = errors.New("invalid stack pattern")
)

Error variables for list_values package.

Functions

func AddCommonListFlags added in v1.170.0

func AddCommonListFlags(cmd *cobra.Command)

AddCommonListFlags adds the common flags to a command.

func FilterAndListComponents

func FilterAndListComponents(stackFlag string, stacksMap map[string]any) ([]string, error)

FilterAndListComponents filters and lists components based on the given stack.

func FilterAndListStacks

func FilterAndListStacks(stacksMap map[string]any, component string) ([]string, error)

FilterAndListStacks filters stacks by the given component

func FilterAndListValues added in v1.170.0

func FilterAndListValues(stacksMap map[string]interface{}, options *FilterOptions) (string, error)

FilterAndListValues filters and lists component values across stacks.

func FilterAndListWorkflows added in v1.155.0

func FilterAndListWorkflows(fileFlag string, listConfig schema.ListConfig, format string, delimiter string) (string, error)

FilterAndListWorkflows filters and lists workflows based on the given file

func ValidateFormat added in v1.155.0

func ValidateFormat(format string) error

ValidateFormat checks if the given format is supported.

func ValidateValuesFormat added in v1.170.0

func ValidateValuesFormat(formatStr string) error

ValidateFormat validates the output format.

Types

type CommonListFlags added in v1.170.0

type CommonListFlags struct {
	Query      string
	MaxColumns int
	Format     string
	Delimiter  string
	Stack      string
}

CommonListFlags represents the common flags used across list commands.

func GetCommonListFlags added in v1.170.0

func GetCommonListFlags(cmd *cobra.Command) (*CommonListFlags, error)

GetCommonListFlags extracts the common flags from a command.

type FilterOptions added in v1.170.0

type FilterOptions struct {
	Component       string
	ComponentFilter string
	Query           string
	IncludeAbstract bool
	MaxColumns      int
	FormatStr       string
	Delimiter       string
	StackPattern    string
}

FilterOptions contains the options for filtering and listing component values.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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