Documentation ¶
Index ¶
- Constants
- Variables
- func KubeconfigListTable(kubeconfigs ...tcp.KubeConfig) [][]string
- func TCPListTable(tcps ...kamajiv1alpha1.TenantControlPlane) [][]string
- type PrintOption
- type Printer
- func (p Printer) Actionf(format string, a ...interface{})
- func (p *Printer) CheckErr(err error)
- func (p *Printer) ExitOnErr(err error)
- func (p Printer) Failuref(format string, a ...interface{})
- func (p Printer) Generatef(format string, a ...interface{})
- func (p Printer) Infof(format string, a ...interface{})
- func (p *Printer) PrintRaw(s string)
- func (p *Printer) PrintTable(data [][]string) error
- func (p Printer) Successf(format string, a ...interface{})
- func (p Printer) Waitingf(format string, a ...interface{})
- func (p Printer) Warningf(format string, a ...interface{})
Constants ¶
View Source
const ( PrefixInfo = `-` PrefixAction = `►` PrefixGenerate = `✚` PrefixWaiting = `◎` PrefixSuccess = `✔` PrefixWarning = `⚠️` PrefixError = `✗` )
Variables ¶
View Source
var ( TCPListHeader = []string{"NAMESPACE", "NAME", "VERSION", "STATUS", "ENDPOINT", "DATA STORE"} KubeconfigListHeader = []string{"NAMESPACE", "TCP", "NAME"} )
Functions ¶
func KubeconfigListTable ¶
func KubeconfigListTable(kubeconfigs ...tcp.KubeConfig) [][]string
func TCPListTable ¶
func TCPListTable(tcps ...kamajiv1alpha1.TenantControlPlane) [][]string
Types ¶
type PrintOption ¶
type PrintOption func(*Printer)
func WithWriter ¶
func WithWriter(w io.Writer) PrintOption
type Printer ¶
type Printer struct { Info *pterm.PrefixPrinter Success *pterm.PrefixPrinter Warning *pterm.PrefixPrinter Error *pterm.PrefixPrinter Action *pterm.PrefixPrinter Generate *pterm.PrefixPrinter Waiting *pterm.PrefixPrinter TablePrinter *pterm.TablePrinter // contains filtered or unexported fields }
Printer represents a helper structure for pretty printing of all the tool's output.
func NewPrinter ¶
func NewPrinter(opts ...PrintOption) *Printer
NewPrinter returns a new Printer struct.
func (*Printer) CheckErr ¶
CheckErr prints a user-friendly error to STDERR and exits with a non-zero exit code.
func (*Printer) ExitOnErr ¶
ExitOnErr aborts the execution in case of errors, without printing any error message.
func (*Printer) PrintTable ¶
PrintTable prints a pretty table with the data argument.
Click to show internal directories.
Click to hide internal directories.