Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EyesPrefix = pterm.Prefix{ Style: &pterm.Style{pterm.FgLightMagenta}, Text: " 👀", } RaisedPrefix = pterm.Prefix{ Style: &pterm.Style{pterm.FgLightMagenta}, Text: " 🙌", } CheckmarkSuccessSpinner = pterm.DefaultSpinner.WithStyle(spinnerStyle).WithMessageStyle(msgStyle) EyesInfoSpinner = pterm.DefaultSpinner.WithStyle(spinnerStyle).WithMessageStyle(msgStyle) ComponentText = pterm.DefaultBasicText.WithStyle(&pterm.ThemeDefault.TreeTextStyle) )
View Source
var ( DefaultObjPrinter = ObjectPrinter{ Quiet: false, Pretty: false, Format: config.Default, TablePrinter: pterm.DefaultTable.WithSeparator(" "), } )
Functions ¶
func StepCounter ¶
func WrapWithSuccessSpinner ¶
func WrapWithSuccessSpinner(msg string, spinner *pterm.SpinnerPrinter, f func() error) error
Types ¶
type ObjectPrinter ¶
type ObjectPrinter struct { Quiet config.QuietFlag Pretty bool Format config.Format TablePrinter *pterm.TablePrinter }
The ObjectPrinter is intended to make it easy to print individual structs and lists of structs for the 'get' and 'list' commands. It can print as a human-readable table, or computer-readable (JSON or YAML)
func (*ObjectPrinter) Print ¶
Print will print a single option or an array/slice of objects. When printing with default table output, it will only print a given set of fields. To specify those fields, the caller should provide the human-readable names for those fields (used for column headers) and a function that can be called on a single struct that returns those fields as strings. When printing JSON or YAML, this will print *all* fields, regardless of the list of fields.
Click to show internal directories.
Click to hide internal directories.