Documentation
¶
Index ¶
- func CreateDockerClient(cfg *manifest.Config) *dockercli.Client
- func CreatePlanner(docker *dockercli.Client, pr ui.Printer) *planner.Planner
- func DisplayDockerInfo(pr ui.Printer, cfg *manifest.Config)
- func GetConfirmation(cmd *cobra.Command, pr ui.Printer, opts ConfirmationOptions) (bool, error)
- func GetDestroyConfirmation(cmd *cobra.Command, pr ui.Printer, opts DestroyConfirmationOptions) (bool, error)
- func LoadConfigWithWarnings(cmd *cobra.Command, pr ui.Printer) (*manifest.Config, error)
- func MaskSecretsSimple(yamlStr string, stack manifest.Stack, strategy string) string
- func ProgressOperation(pr ui.StdPrinter, message string, operation func(*ui.Progress) error) error
- func RunWithRollingOrDirect(cmd *cobra.Command, verbose bool, ...) (string, bool, error)
- func SelectManifestPath(cmd *cobra.Command, pr ui.Printer, root string, maxDepth int) (string, bool, error)
- func SpinnerOperation(pr ui.StdPrinter, message string, operation func() error) error
- func ValidateWithDocker(ctx context.Context, cfg *manifest.Config, docker *dockercli.Client) error
- type CLIContext
- type ConfirmationOptions
- type DestroyConfirmationOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDockerClient ¶
CreateDockerClient creates a Docker client using config context and identifier.
func CreatePlanner ¶
CreatePlanner creates a planner with Docker client and printer configured.
func DisplayDockerInfo ¶
DisplayDockerInfo shows the Docker context and identifier information
func GetConfirmation ¶
GetConfirmation handles user confirmation with TTY detection and appropriate prompting.
func GetDestroyConfirmation ¶
func GetDestroyConfirmation(cmd *cobra.Command, pr ui.Printer, opts DestroyConfirmationOptions) (bool, error)
GetDestroyConfirmation handles user confirmation for destroy operations, requiring the user to type the identifier name.
func LoadConfigWithWarnings ¶
LoadConfigWithWarnings loads the configuration from the --config flag and displays warnings.
func MaskSecretsSimple ¶
MaskSecretsSimple redacts secret-like values from a YAML string based on stack config. This is a pragmatic heuristic: it masks occurrences of values provided via stack/environment inline env and sops secrets (after decryption via BuildInlineEnv), as well as common sensitive keys.
func ProgressOperation ¶
ProgressOperation runs an operation with a progress bar.
func RunWithRollingOrDirect ¶
func RunWithRollingOrDirect(cmd *cobra.Command, verbose bool, fn func(runCtx context.Context) (string, error)) (string, bool, error)
RunWithRollingOrDirect executes fn while showing rolling logs when stdout is a TTY and verbose is false. Returns the fn's string result and whether the rolling TUI was used.
func SelectManifestPath ¶
func SelectManifestPath(cmd *cobra.Command, pr ui.Printer, root string, maxDepth int) (string, bool, error)
SelectManifestPath scans for manifest files up to maxDepth and presents an interactive picker of docker.context values when attached to a TTY. Returns the chosen manifest path and whether a selection was made. On non-TTY, returns ok=false with no error.
func SpinnerOperation ¶
func SpinnerOperation(pr ui.StdPrinter, message string, operation func() error) error
SpinnerOperation runs an operation with a spinner, automatically handling start/stop.
Types ¶
type CLIContext ¶
type CLIContext struct {
Ctx context.Context
Config *manifest.Config
Docker *dockercli.Client
Printer ui.Printer
Planner *planner.Planner
}
CLIContext contains all the components needed for most CLI operations.
func SetupCLIContext ¶
func SetupCLIContext(cmd *cobra.Command) (*CLIContext, error)
SetupCLIContext performs the standard CLI setup: load config, create Docker client, validate, and create planner.
func (*CLIContext) ApplyPlan ¶
func (ctx *CLIContext) ApplyPlan() error
ApplyPlan executes the plan with progress tracking.
func (*CLIContext) BuildDestroyPlan ¶
func (ctx *CLIContext) BuildDestroyPlan() (*planner.Plan, error)
BuildDestroyPlan creates a destruction plan for all managed resources.
func (*CLIContext) BuildPlan ¶
func (ctx *CLIContext) BuildPlan() (*planner.Plan, error)
BuildPlan creates a plan using the CLI context with spinner UI.
func (*CLIContext) ExecuteDestroy ¶
func (ctx *CLIContext) ExecuteDestroy(bgCtx context.Context) error
ExecuteDestroy executes the destruction of all managed resources.
func (*CLIContext) PrunePlan ¶
func (ctx *CLIContext) PrunePlan() error
PrunePlan executes pruning with spinner.
type ConfirmationOptions ¶
ConfirmationOptions configures the confirmation prompt behavior.
type DestroyConfirmationOptions ¶
DestroyConfirmationOptions configures the destroy confirmation prompt behavior.