printer

package
v0.44.3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ColorBold       = color.New(color.Bold)
	ColorGreenBold  = color.New(color.FgGreen).Add(color.Bold)
	ColorYellowBold = color.New(color.FgYellow).Add(color.Bold)
	ColorRedBold    = color.New(color.FgRed).Add(color.Bold)
)

Functions

This section is empty.

Types

type Format

type Format int
const (
	FormatUnspecified Format = iota
	FormatHuman
	FormatJSON
	FormatCSV
)

func (*Format) Set added in v0.41.0

func (f *Format) Set(s string) error

func (Format) String added in v0.41.0

func (f Format) String() string

func (*Format) Type

func (f *Format) Type() string

type Printer

type Printer struct {
	Format Format
	// contains filtered or unexported fields
}

Printer is a helper for printing output in a specific format. It differentiates between human-readable and machine-readable output. Regular log messages are always produced as human-readable output. Human-readable output is discarded when the format is not FormatHuman.

func NewPrinter

func NewPrinter(format Format) *Printer

func (*Printer) OverrideDataOutput added in v0.42.0

func (p *Printer) OverrideDataOutput(out io.Writer)

func (*Printer) OverrideHumanOutput added in v0.42.0

func (p *Printer) OverrideHumanOutput(out io.Writer)

func (*Printer) Print

func (p *Printer) Print(i ...interface{})

func (*Printer) PrintData added in v0.42.0

func (p *Printer) PrintData(v interface{})

func (*Printer) PrintInvites added in v0.42.0

func (p *Printer) PrintInvites(invites []*adminv1.UserInvite)

func (*Printer) PrintMembers added in v0.42.0

func (p *Printer) PrintMembers(members []*adminv1.Member)

func (*Printer) PrintOrgs added in v0.42.0

func (p *Printer) PrintOrgs(orgs []*adminv1.Organization, defaultOrg string)

func (*Printer) PrintProjects added in v0.42.0

func (p *Printer) PrintProjects(projs []*adminv1.Project)

func (*Printer) PrintServiceTokens added in v0.42.0

func (p *Printer) PrintServiceTokens(sts []*adminv1.ServiceToken)

func (*Printer) PrintServices added in v0.42.0

func (p *Printer) PrintServices(svcs []*adminv1.Service)

func (*Printer) PrintUsers added in v0.42.0

func (p *Printer) PrintUsers(users []*adminv1.User)

func (*Printer) Printf

func (p *Printer) Printf(format string, i ...interface{})

func (*Printer) PrintfBold added in v0.42.0

func (p *Printer) PrintfBold(str string, i ...interface{})

func (*Printer) PrintfError added in v0.42.0

func (p *Printer) PrintfError(str string, i ...interface{})

func (*Printer) PrintfSuccess added in v0.42.0

func (p *Printer) PrintfSuccess(str string, i ...interface{})

func (*Printer) PrintfWarn added in v0.42.0

func (p *Printer) PrintfWarn(str string, i ...interface{})

func (*Printer) Println

func (p *Printer) Println(i ...interface{})

Jump to

Keyboard shortcuts

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