cmdutil

package
v0.0.0-...-d9c1391 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 46 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ApiServerAddrOverride string
)

Commands that set app will have its value stored here

View Source
var Editor string
View Source
var ForceAsyncSetDesiredState bool
View Source
var (
	OutputFormat string = "table"
)

Functions

func ColorForStatus

func ColorForStatus(status ds_model_pb.Status) *color.Color

func EditOrReadConfig

func EditOrReadConfig[ConfigT proto.Message](ctx context.Context, inputFileType, maybeInputFile, startingYaml string, config ConfigT, validate func(context.Context, ConfigT) ([]*common_config_pb.DangerousAction, error), finalPromptMessage string, noPrompt bool, options ...EditOptions[ConfigT]) ([]*common_config_pb.DangerousAction, error)

func EditUntilValid

func EditUntilValid[Parsed proto.Message](ctx context.Context, file string, parse func(file string) (Parsed, error), validate func(ctx context.Context, m Parsed) error) (emptyParsed Parsed, err error)

func FormatTimeForDisplay

func FormatTimeForDisplay(t time.Time) string

func GetApiTokenManagerClient

func GetApiTokenManagerClient() auth_pb.ApiTokenManagerClient

func GetApplicationManagerClient

func GetApplicationManagerClient() application_pb.ApplicationManagerClient

func GetBlobsManagerClient

func GetBlobsManagerClient() blobs_pb.BlobsManagerClient

func GetDeploymentManagerClient

func GetDeploymentManagerClient() deployment_pb.DeploymentManagerClient

func GetDesiredStateManagerClient

func GetDesiredStateManagerClient() ds_pb.DesiredStateManagerClient

func GetEnvironmentManagerClient

func GetEnvironmentManagerClient() environment_pb.EnvironmentManagerClient

func GetEventsManagerClient

func GetEventsManagerClient() events_pb.EventsManagerClient

func GetHealthClient

func GetHealthClient() grpc_health_v1.HealthClient

func GetObjectManagerClient

func GetObjectManagerClient() object_pb.ObjectManagerClient

func GetProtectionManagerClient

func GetProtectionManagerClient() protection_pb.ProtectionManagerClient

func GetRecipeManagerClient

func GetRecipeManagerClient() recipe_pb.RecipeManagerClient

func GetSecretsManagerClient

func GetSecretsManagerClient() secrets_pb.SecretsManagerClient

func GetServiceManagerClient

func GetServiceManagerClient() service_pb.ServiceManagerClient

func GetWorkflowManagerClient

func GetWorkflowManagerClient() workflow_pb.WorkflowManagerClient

func LaunchEditor

func LaunchEditor(file string) error

func MaybePage

func MaybePage(input io.Reader) error

func Must

func Must(err error)

func MustGetString

func MustGetString(cmd *cobra.Command, key string) string

func ProcessEnvVars

func ProcessEnvVars(envVars []string, secretEnvVars []string) (map[string]*common_config_pb.EnvValue, error)

Converts a list of VAR=VALUE strings to an env variable map

func Prompt

func Prompt(message string) string

func PromptDangerousActions

func PromptDangerousActions(actions []*common_config_pb.DangerousAction)

func PromptYesNo

func PromptYesNo(message string) bool

func RenderWatch

func RenderWatch(ctx context.Context, render func(ctx context.Context, writer io.Writer) (bool, error)) error

func SetOutputFormat

func SetOutputFormat(format string) error

func ShouldPrintColor

func ShouldPrintColor() bool

func ValidOutputFormats

func ValidOutputFormats() []string

func ValidateAndRefreshAuthPreRun

func ValidateAndRefreshAuthPreRun(cmd *cobra.Command, args []string)

Using PreRunE causes the help text to be printed on error, which is not what we want.

func ValidateAndRefreshAuthPreRunE

func ValidateAndRefreshAuthPreRunE(cmd *cobra.Command, args []string) error

func WriteOutput

func WriteOutput(writer io.Writer, listing *OutputListing) error

func WriteStdout

func WriteStdout(listing *OutputListing) error

Types

type CIDefaults

type CIDefaults struct {
	Environment   CIEnvironment
	Repository    string
	Commit        string
	BaseDirectory string
}

func DetectCIDefaults

func DetectCIDefaults() *CIDefaults

type CIEnvironment

type CIEnvironment string
const (
	CircleciEnvironment      CIEnvironment = "circleci"
	GitHubActionsEnvironment CIEnvironment = "gha"
)

type EditOptions

type EditOptions[T any] func(editOptions[T]) editOptions[T]

func WithRawPostProcess

func WithRawPostProcess[T any](postProcess func([]byte) ([]byte, error)) EditOptions[T]

func WithTypedPostProcess

func WithTypedPostProcess[T any](postProcess func(T) (T, error)) EditOptions[T]

type OutputListing

type OutputListing struct {
	// contains filtered or unexported fields
}

func NewOutputListing

func NewOutputListing(headers ...string) *OutputListing

func (*OutputListing) AddRow

func (l *OutputListing) AddRow(values ...any)

func (*OutputListing) WriteJson

func (l *OutputListing) WriteJson(output io.Writer) error

func (*OutputListing) WriteTable

func (l *OutputListing) WriteTable(output io.Writer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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