Documentation
¶
Index ¶
- func CreateDockerClient(cfg *manifest.Config) *dockercli.Client
- func CreatePlanner(docker *dockercli.Client, pr ui.Printer) *planner.Planner
- func Execute() int
- 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 ProgressOperation(pr ui.StdPrinter, message string, operation func(*ui.Progress) error) error
- func RunWithRollingOrDirect(cmd *cobra.Command, verbose bool, ...) (string, bool, error)
- func SpinnerOperation(pr ui.StdPrinter, message string, operation func() error) error
- func TestPrintUserFriendly(err error)
- func ValidateWithDocker(ctx context.Context, cfg *manifest.Config, docker *dockercli.Client) error
- func Version() string
- func VersionDetailed() string
- func VersionSimple() string
- 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 Execute ¶
func Execute() int
Execute runs the root command and handles error formatting and exit codes.
func GetConfirmation ¶
GetConfirmation handles user confirmation with TTY detection and appropriate prompting.
func GetDestroyConfirmation ¶ added in v0.2.0
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 ProgressOperation ¶
ProgressOperation runs an operation with a progress bar.
func RunWithRollingOrDirect ¶ added in v0.4.1
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 SpinnerOperation ¶
func SpinnerOperation(pr ui.StdPrinter, message string, operation func() error) error
SpinnerOperation runs an operation with a spinner, automatically handling start/stop.
func TestPrintUserFriendly ¶
func TestPrintUserFriendly(err error)
TestPrintUserFriendly exposes printUserFriendly for testing
func ValidateWithDocker ¶
ValidateWithDocker runs validation against the configuration and Docker client.
func VersionDetailed ¶
func VersionDetailed() string
VersionDetailed returns version info with build metadata if available.
func VersionSimple ¶ added in v0.2.2
func VersionSimple() string
VersionSimple returns version number with build info for --version flag
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 ¶ added in v0.2.0
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 ¶ added in v0.2.0
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 ¶ added in v0.2.0
DestroyConfirmationOptions configures the destroy confirmation prompt behavior.