printer

package
v0.47.4 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 13 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) PrintDataWithTitle added in v0.46.0

func (p *Printer) PrintDataWithTitle(v interface{}, title string)

func (*Printer) PrintInvites added in v0.42.0

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

func (*Printer) PrintMagicAuthTokens added in v0.47.0

func (p *Printer) PrintMagicAuthTokens(tkns []*adminv1.MagicAuthToken)

func (*Printer) PrintMemberUsergroups added in v0.47.2

func (p *Printer) PrintMemberUsergroups(members []*adminv1.MemberUsergroup)

func (*Printer) PrintMemberUsers added in v0.47.2

func (p *Printer) PrintMemberUsers(members []*adminv1.MemberUser)

func (*Printer) PrintOrgs added in v0.42.0

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

func (*Printer) PrintPlans added in v0.47.0

func (p *Printer) PrintPlans(plans []*adminv1.BillingPlan)

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) PrintSubscriptions added in v0.47.0

func (p *Printer) PrintSubscriptions(subs []*adminv1.Subscription)

func (*Printer) PrintUsergroupMembers added in v0.47.2

func (p *Printer) PrintUsergroupMembers(members []*adminv1.MemberUser)

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