shared

package
v1.205.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package shared provides utilities shared between terraform and its subpackages.

Index

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

func FilterDeployableComponents(terraformComponents map[string]any) []string

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

func HandlePromptError(err error, name string) error

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

func IsComponentDeployable(componentConfig any) bool

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

func PromptForComponent(cmd *cobra.Command, stack string) (string, error)

PromptForComponent shows an interactive selector for component selection. If stack is provided, filters components to only those in that stack.

func PromptForStack

func PromptForStack(cmd *cobra.Command, component string) (string, error)

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

func ValidateStackExists(cmd *cobra.Command, stack string) error

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.

Jump to

Keyboard shortcuts

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