Documentation
¶
Index ¶
- Constants
- Variables
- func AddCommonListFlags(cmd *cobra.Command)
- func FilterAndListComponents(stackFlag string, stacksMap map[string]any) ([]string, error)
- func FilterAndListStacks(stacksMap map[string]any, component string) ([]string, error)
- func FilterAndListValues(stacksMap map[string]interface{}, options *FilterOptions) (string, error)
- func FilterAndListWorkflows(fileFlag string, listConfig schema.ListConfig, format string, delimiter string) (string, error)
- func ValidateFormat(format string) error
- func ValidateValuesFormat(formatStr string) error
- type CommonListFlags
- type FilterOptions
Constants ¶
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.
const ( FormatTable = "table" FormatJSON = "json" FormatYAML = "yaml" FormatCSV = "csv" FormatTSV = "tsv" )
const DefaultMaxColumns = 10
DefaultMaxColumns is the default maximum number of columns to display.
Variables ¶
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.
var (
ErrInvalidStackPattern = errors.New("invalid stack pattern")
)
Error variables for list_values package.
Functions ¶
func AddCommonListFlags ¶ added in v1.170.0
AddCommonListFlags adds the common flags to a command.
func FilterAndListComponents ¶
FilterAndListComponents filters and lists components based on the given stack.
func FilterAndListStacks ¶
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
ValidateFormat checks if the given format is supported.
func ValidateValuesFormat ¶ added in v1.170.0
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.