Documentation
¶
Overview ¶
Package di exposes shared dependency injection helpers for KSail commands.
Index ¶
- func ResolveClusterProvisionerFactory(injector Injector) (clusterprovisioner.Factory, error)
- func ResolveTimer(injector Injector) (timer.Timer, error)
- func RunEWithRuntime(runtimeContainer *Runtime, ...) func(*cobra.Command, []string) error
- func WithTimer(handler func(cmd *cobra.Command, injector Injector, tmr timer.Timer) error) func(cmd *cobra.Command, injector Injector) error
- type Injector
- type Module
- type Runtime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveClusterProvisionerFactory ¶
func ResolveClusterProvisionerFactory( injector Injector, ) (clusterprovisioner.Factory, error)
ResolveClusterProvisionerFactory retrieves the cluster provisioner factory dependency.
func ResolveTimer ¶
ResolveTimer retrieves the timer dependency from the injector with consistent error handling.
func RunEWithRuntime ¶
func RunEWithRuntime( runtimeContainer *Runtime, handler func(cmd *cobra.Command, injector Injector) error, ) func(*cobra.Command, []string) error
RunEWithRuntime returns a cobra RunE function that resolves dependencies using the provided runtime container. The handler is executed with the active command and resolved injector when the command runs.
Types ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime owns shared dependency registration for Cobra commands.
func New ¶
New constructs a Runtime with the provided base modules. Modules are applied in the order supplied when invoking commands.
func NewRuntime ¶
func NewRuntime() *Runtime
NewRuntime constructs the shared runtime container used by root command and tests.