Documentation
¶
Index ¶
- Variables
- func CaptureOutput(f func()) string
- func CaptureOutputErr(f func() error) (string, error)
- func FormatCommandName(name string, noColor bool) string
- func FormatConfirmation(msg string, noColor bool) string
- func FormatExample(example string, noColor bool) string
- func FormatJSONExample(json string, noColor bool) string
- func FormatNewValue(value string, noColor bool) string
- func FormatOldValue(value string, noColor bool) string
- func FormatOptionalFlag(flag string, description string, noColor bool) string
- func FormatPrompt(msg string, noColor bool) string
- func FormatRequiredFlag(flag string, description string, noColor bool) string
- func FormatSuccess(msg string, noColor bool) string
- func FormatUID(uid string, noColor bool) string
- func IsQuiet() bool
- func IsTerminal() bool
- func IsVerbose() bool
- func PrintError(format string, noColor bool, args ...interface{})
- func PrintInfo(format string, noColor bool, args ...interface{})
- func PrintOutput[T OutputFields](data []T, format string, noColor bool) error
- func PrintResourceCreated(resourceType, uid string, noColor bool)
- func PrintResourceDeleted(resourceType, uid string, immediate, noColor bool)
- func PrintResourceSuccess(resourceType, action, uid string, noColor bool)
- func PrintResourceUpdated(resourceType, uid string, noColor bool)
- func PrintSuccess(format string, noColor bool, args ...interface{})
- func PrintSuccessWithOutput(format string, noColor bool, outputFormat string, args ...interface{})
- func PrintVerbose(format string, noColor bool, args ...interface{})
- func PrintWarning(format string, noColor bool, args ...interface{})
- func SetIsTerminal(val bool)
- func SetOutputFormat(format string)
- func SetVerbosity(level string)
- func StripANSIColors(s string) string
- type Output
- type OutputFields
- type ResourceTag
- type Spinner
- func NewSpinner(noColor bool) *Spinner
- func NewSpinnerWasm(noColor bool, outputFormat string) *Spinner
- func NewSpinnerWithOutput(noColor bool, outputFormat string) *Spinner
- func PrintCustomSpinner(action, resourceId string, noColor bool) *Spinner
- func PrintListingResourceTags(resourceType, uid string, noColor bool) *Spinner
- func PrintLoggingIn(noColor bool) *Spinner
- func PrintLoggingInWithOutput(noColor bool, outputFormat string) *Spinner
- func PrintResourceCreating(resourceType, uid string, noColor bool) *Spinner
- func PrintResourceDeleting(resourceType, uid string, noColor bool) *Spinner
- func PrintResourceGetting(resourceType, uid string, noColor bool) *Spinner
- func PrintResourceGettingWithOutput(resourceType, uid string, noColor bool, outputFormat string) *Spinner
- func PrintResourceListing(resourceType string, noColor bool) *Spinner
- func PrintResourceUpdating(resourceType, uid string, noColor bool) *Spinner
- func PrintResourceValidating(resourceType string, noColor bool) *Spinner
- type SpinnerInterface
Constants ¶
This section is empty.
Variables ¶
var ( RadRed = color.New(color.FgRed).Add(color.Bold).SprintFunc() DeepNightBlue = color.New(color.FgBlue).Add(color.FgBlack).SprintFunc() MegaportYellow = color.New(color.FgHiYellow).SprintFunc() MegaportOrange = color.New(color.FgHiRed).SprintFunc() MegaportRed = color.New(color.FgRed).SprintFunc() MegaportPurple = color.New(color.FgMagenta).SprintFunc() RadRedReadable = color.New(color.FgHiRed).Add(color.Bold).SprintFunc() DeepBlueReadable = color.New(color.FgBlue).Add(color.Bold).SprintFunc() YellowReadable = color.New(color.FgYellow).Add(color.Bold).SprintFunc() OrangeReadable = color.New(color.FgRed).Add(color.FgYellow).SprintFunc() PurpleReadable = color.New(color.FgHiMagenta).Add(color.Bold).SprintFunc() NexusBlue = color.New(color.FgBlue).Add(color.Bold).SprintFunc() DodgerBlue = color.New(color.FgHiBlue).Add(color.Bold).SprintFunc() SkyBlue = color.New(color.FgHiCyan).SprintFunc() PurpleCloud = color.New(color.FgMagenta).Add(color.Bold).SprintFunc() Plum = color.New(color.FgHiMagenta).SprintFunc() Mauve = color.New(color.FgHiMagenta).Add(color.Faint).SprintFunc() Pink = color.New(color.FgMagenta).Add(color.Italic).SprintFunc() Magenta = color.New(color.FgHiMagenta).Add(color.Bold).SprintFunc() SunsetOrange = color.New(color.FgRed).Add(color.FgHiYellow).SprintFunc() BlackHole = color.New(color.FgBlack).Add(color.Bold).SprintFunc() DarkBlue = color.New(color.FgBlue).Add(color.Underline).SprintFunc() GoldYellow = color.New(color.FgYellow).Add(color.Bold).SprintFunc() Teal = color.New(color.FgCyan).Add(color.Bold).SprintFunc() LinkGreen = color.New(color.FgGreen).Add(color.Bold).SprintFunc() ElectricLime = color.New(color.FgHiGreen).SprintFunc() )
Functions ¶
func CaptureOutput ¶
func CaptureOutput(f func()) string
func CaptureOutputErr ¶
func FormatCommandName ¶
func FormatConfirmation ¶
func FormatExample ¶
func FormatJSONExample ¶
func FormatNewValue ¶ added in v0.3.4
func FormatOldValue ¶ added in v0.3.4
func FormatOptionalFlag ¶
func FormatPrompt ¶
func FormatRequiredFlag ¶
func FormatSuccess ¶
func IsQuiet ¶ added in v0.5.3
func IsQuiet() bool
IsQuiet returns true when quiet mode is active. In quiet mode, informational messages and spinners are suppressed.
func IsTerminal ¶ added in v0.5.4
func IsTerminal() bool
IsTerminal returns true if stdout is connected to a terminal (not piped).
func IsVerbose ¶ added in v0.5.3
func IsVerbose() bool
IsVerbose returns true when verbose mode is active.
func PrintError ¶
func PrintOutput ¶
func PrintOutput[T OutputFields](data []T, format string, noColor bool) error
PrintOutput prints data in the specified format
func PrintResourceCreated ¶
func PrintResourceDeleted ¶
func PrintResourceSuccess ¶
func PrintResourceUpdated ¶
func PrintSuccess ¶
func PrintSuccessWithOutput ¶ added in v0.4.7
func PrintVerbose ¶ added in v0.5.3
PrintVerbose prints a debug message only when verbose mode is active.
func PrintWarning ¶
func SetIsTerminal ¶ added in v0.5.4
func SetIsTerminal(val bool)
SetIsTerminal overrides the cached TTY detection result. Intended for tests.
func SetOutputFormat ¶ added in v0.4.7
func SetOutputFormat(format string)
func SetVerbosity ¶ added in v0.5.3
func SetVerbosity(level string)
SetVerbosity sets the global verbosity level ("normal", "quiet", or "verbose").
func StripANSIColors ¶
Types ¶
type Output ¶
type Output interface {
// contains filtered or unexported methods
}
Output is a marker interface for output types
type OutputFields ¶
type OutputFields interface {
any
}
OutputFields is a constraint for types that can be output
type ResourceTag ¶ added in v0.4.3
type ResourceTag struct {
Key string `json:"key" header:"Key"`
Value string `json:"value" header:"Value"`
}
ResourceTag represents a key-value tag pair
type Spinner ¶ added in v0.4.0
type Spinner struct {
// contains filtered or unexported fields
}
func NewSpinner ¶ added in v0.4.0
func NewSpinnerWasm ¶ added in v0.4.9
NewSpinnerWasm creates a spinner optimized for WASM display This is the non-WASM build version that uses the regular spinner
func NewSpinnerWithOutput ¶ added in v0.4.7
func PrintCustomSpinner ¶ added in v0.4.4
func PrintListingResourceTags ¶ added in v0.4.3
func PrintLoggingIn ¶ added in v0.4.3
func PrintLoggingInWithOutput ¶ added in v0.4.7
func PrintResourceCreating ¶ added in v0.4.0
func PrintResourceDeleting ¶ added in v0.4.0
func PrintResourceGetting ¶ added in v0.4.0
func PrintResourceGettingWithOutput ¶ added in v0.4.7
func PrintResourceListing ¶ added in v0.4.0
func PrintResourceUpdating ¶ added in v0.4.0
func PrintResourceValidating ¶ added in v0.4.3
func (*Spinner) StopWithSuccess ¶ added in v0.4.0
type SpinnerInterface ¶ added in v0.4.9
type SpinnerInterface interface {
Start(message string)
Stop()
}
SpinnerInterface allows different spinner implementations (WASM vs native)