Documentation
¶
Overview ¶
Package shared provides utilities shared between terraform and its subpackages.
Index ¶
- func ComponentsArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func FilterDeployableComponents(terraformComponents map[string]any) []string
- func HandlePromptError(err error, name string) error
- func IsComponentDeployable(componentConfig any) bool
- func PromptForComponent(cmd *cobra.Command, stack string) (string, error)
- func PromptForStack(cmd *cobra.Command, component string) (string, error)
- func StackFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func ValidateStackExists(cmd *cobra.Command, stack string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComponentsArgCompletion ¶
func ComponentsArgCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
ComponentsArgCompletion provides shell completion for component positional arguments. Checks for --stack flag and filters components accordingly.
func FilterDeployableComponents ¶ added in v1.205.0
FilterDeployableComponents returns only components that can be deployed. Filters out abstract and disabled components from the terraform components map. Returns a sorted slice of deployable component names.
func HandlePromptError ¶
HandlePromptError processes errors from interactive prompts. Returns nil if the error should be ignored, or the error if it should propagate.
func IsComponentDeployable ¶ added in v1.205.0
IsComponentDeployable checks if a component can be deployed (not abstract, not disabled). Returns false for components with metadata.type: abstract or metadata.enabled: false.
func PromptForComponent ¶
PromptForComponent shows an interactive selector for component selection. If stack is provided, filters components to only those in that stack.
func PromptForStack ¶
PromptForStack shows an interactive selector for stack selection. If component is provided, filters stacks to only those containing the component.
func StackFlagCompletion ¶
func StackFlagCompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
StackFlagCompletion provides shell completion for the --stack flag. If a component was provided as the first positional argument, it filters stacks to only those containing that component.
func ValidateStackExists ¶ added in v1.205.0
ValidateStackExists checks if the provided stack name exists and returns an error with suggestions if it doesn't. The cmd parameter is used to respect global CLI flags (--base-path, --config, --config-path, --profile).
Types ¶
This section is empty.