Help us shape the future of Go! Take the 2026 Go Developer Survey

cmdutil

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cmdutil contains shared helpers used by the 'devsy platform' 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

View Source
const (
	HeaderName        = "Name"
	HeaderDisplayName = "Display Name"
)

Shared table headers used across platform resource listings.

Variables

This section is empty.

Functions

func AddHostFlag

func AddHostFlag(c *cobra.Command, dest *string, opts ...HostFlagOption)

AddHostFlag registers the required --host flag, binds its env var, and applies opts.

func FindPlatformProvider

func FindPlatformProvider(
	ctx context.Context,
	context, provider, host string,
) (*config.Config, *providerpkg.ProviderConfig, error)

FindPlatformProvider resolves the devsy config and provider config for the given platform host.

func HostRunE

func HostRunE(
	globalFlags *platformflags.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

func MarkAgentExecuted(cmd *cobra.Command, _ []string)

MarkAgentExecuted flags the root command as executed by an agent. Use it as a PersistentPreRun.

Types

type HostFlagOption

type HostFlagOption func(*hostFlagOptions)

HostFlagOption configures AddHostFlag.

func WithHostCompletion

func WithHostCompletion(globalFlags *platformflags.GlobalFlags) HostFlagOption

WithHostCompletion registers shell completion for --host listing platform instances.

type HostRunFunc

type HostRunFunc func(
	ctx context.Context,
	devsyConfig *config.Config,
	provider *providerpkg.ProviderConfig,
) error

HostRunFunc runs a host-scoped platform command with its resolved devsy config and provider.

Jump to

Keyboard shortcuts

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