output

package
v0.0.0-...-ec1031e Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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) Actionf

func (p Printer) Actionf(format string, a ...interface{})

func (*Printer) CheckErr

func (p *Printer) CheckErr(err error)

CheckErr prints a user-friendly error to STDERR and exits with a non-zero exit code.

func (*Printer) ExitOnErr

func (p *Printer) ExitOnErr(err error)

ExitOnErr aborts the execution in case of errors, without printing any error message.

func (Printer) Failuref

func (p Printer) Failuref(format string, a ...interface{})

func (Printer) Generatef

func (p Printer) Generatef(format string, a ...interface{})

func (Printer) Infof

func (p Printer) Infof(format string, a ...interface{})

func (*Printer) PrintRaw

func (p *Printer) PrintRaw(s string)

PrintRaw prints the data as string raw to the configured io.Writer.

func (*Printer) PrintTable

func (p *Printer) PrintTable(data [][]string) error

PrintTable prints a pretty table with the data argument.

func (Printer) Successf

func (p Printer) Successf(format string, a ...interface{})

func (Printer) Waitingf

func (p Printer) Waitingf(format string, a ...interface{})

func (Printer) Warningf

func (p Printer) Warningf(format string, a ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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