Documentation
¶
Overview ¶
Package proutil contains shared helpers used by the 'devsy pro' command and its resource sub-groups (workspace, cluster, project, template). It exists to avoid an import cycle between cmd/pro and its child packages.
Index ¶
- Constants
- func AddHostFlag(c *cobra.Command, dest *string, opts ...HostFlagOption)
- func FindProProvider(ctx context.Context, context, provider, host string) (*config.Config, *providerpkg.ProviderConfig, error)
- func HostRunE(globalFlags *proflags.GlobalFlags, host *string, run HostRunFunc) func(*cobra.Command, []string) error
- func MarkAgentExecuted(cmd *cobra.Command, _ []string)
- type HostFlagOption
- type HostRunFunc
Constants ¶
const ( HeaderName = "Name" HeaderDisplayName = "Display Name" )
Shared table headers used across pro resource listings.
Variables ¶
This section is empty.
Functions ¶
func AddHostFlag ¶ added in v1.24.0
func AddHostFlag(c *cobra.Command, dest *string, opts ...HostFlagOption)
AddHostFlag registers the required --host flag, binds its env var, and applies opts.
func FindProProvider ¶
func FindProProvider( ctx context.Context, context, provider, host string, ) (*config.Config, *providerpkg.ProviderConfig, error)
FindProProvider resolves the devsy config and provider config for the given pro host.
func HostRunE ¶ added in v1.24.0
func HostRunE( globalFlags *proflags.GlobalFlags, host *string, run HostRunFunc, ) func(*cobra.Command, []string) error
HostRunE returns a RunE that resolves the provider for *host and passes it to run. *host is read when the command runs, after flag parsing.
func MarkAgentExecuted ¶ added in v1.24.0
MarkAgentExecuted flags the root command as executed by an agent. Use it as a PersistentPreRun.
Types ¶
type HostFlagOption ¶ added in v1.24.0
type HostFlagOption func(*hostFlagOptions)
HostFlagOption configures AddHostFlag.
func WithHostCompletion ¶ added in v1.24.0
func WithHostCompletion(globalFlags *proflags.GlobalFlags) HostFlagOption
WithHostCompletion registers shell completion for --host listing pro instances.
type HostRunFunc ¶ added in v1.24.0
type HostRunFunc func( ctx context.Context, devsyConfig *config.Config, provider *providerpkg.ProviderConfig, ) error
HostRunFunc runs a host-scoped pro command with its resolved devsy config and provider.