shared

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package shared provides reusable helpers for command wiring.

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingClusterProvisionerDependency = errors.New("missing cluster provisioner dependency")

ErrMissingClusterProvisionerDependency is returned when the cluster provisioner is nil.

Functions

func HandleLifecycleRunE

func HandleLifecycleRunE(
	cmd *cobra.Command,
	cfgManager *ksailconfigmanager.ConfigManager,
	deps LifecycleDeps,
	config LifecycleConfig,
) error

HandleLifecycleRunE executes a cluster lifecycle workflow.

func LoadConfig

func LoadConfig(
	cfgManager *ksailconfigmanager.ConfigManager,
	deps ConfigLoadDeps,
) error

LoadConfig loads the KSail configuration using the provided dependencies.

func NewConfigLoaderRunE

func NewConfigLoaderRunE(runtimeContainer *runtime.Runtime) func(*cobra.Command, []string) error

NewConfigLoaderRunE creates a cobra RunE function that loads the KSail configuration.

func NewLifecycleCommandWrapper

func NewLifecycleCommandWrapper(
	runtimeContainer *runtime.Runtime,
	cfgManager *ksailconfigmanager.ConfigManager,
	config LifecycleConfig,
) func(*cobra.Command, []string) error

NewLifecycleCommandWrapper creates a command wrapper for lifecycle operations.

Types

type ConfigLoadDeps

type ConfigLoadDeps struct {
	Timer timer.Timer
}

ConfigLoadDeps provides dependencies required for simple config-loading commands.

type LifecycleAction

type LifecycleAction func(
	ctx context.Context,
	provisioner clusterprovisioner.ClusterProvisioner,
	clusterName string,
) error

LifecycleAction defines a function that performs an action on a cluster provisioner.

type LifecycleConfig

type LifecycleConfig struct {
	TitleEmoji         string
	TitleContent       string
	ActivityContent    string
	SuccessContent     string
	ErrorMessagePrefix string
	Action             LifecycleAction
}

LifecycleConfig contains the configuration for a lifecycle operation.

type LifecycleDeps

type LifecycleDeps struct {
	Timer   timer.Timer
	Factory clusterprovisioner.Factory
}

LifecycleDeps contains the dependencies required to handle lifecycle commands.

Jump to

Keyboard shortcuts

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