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

proutil

package
v1.25.0-beta.2 Latest Latest
Warning

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

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

Documentation

Overview

Package proutil 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 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 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 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

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

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 platform 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 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