shared

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package shared provides common utilities for provider-based commands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddProviderSubcommands

func AddProviderSubcommands(parent *cobra.Command, opts ProviderSubcommandOptions)

AddProviderSubcommands creates a subcommand for each qualifying provider.

func CreateAndConfigureProvider

func CreateAndConfigureProvider(cmd *cobra.Command, providerType string) (provider.Instance, error)

CreateAndConfigureProvider creates a provider instance and configures it from flags. The instance is fully configured and Setup() has been called.

Types

type ProviderSubcommandOptions

type ProviderSubcommandOptions struct {
	// RequireChecks filters to only providers that support checks
	RequireChecks bool
	// SetupFlags adds extra flags to the subcommand (e.g., --check, --output)
	SetupFlags func(*cobra.Command, provider.Instance)
	// RunFunc is the command handler
	RunFunc func(cmd *cobra.Command, providerType string) error
}

ProviderSubcommandOptions configures the creation of provider subcommands.

Jump to

Keyboard shortcuts

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