display

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UNICODEStyle   = table.StyleRounded
	ASCIIStyle     = table.StyleDefault
	DefaultTBStyle = ASCIIStyle
)
View Source
var (
	CustomTermSize uint
)
View Source
var IncludeHyperlink = false
View Source
var Output io.Writer = os.Stdout

Functions

func DefaultTB added in v0.8.0

func DefaultTB(w table.Writer)

func RawPrint added in v0.8.0

func RawPrint(toPrint ...any) (n int, err error)

func WidthLen

func WidthLen(str string) int

func WidthNoHyperLinkLen added in v0.9.0

func WidthNoHyperLinkLen(str string) int

Types

type Across

type Across struct {
	*bufio.Writer
	// contains filtered or unexported fields
}

func (Across) AddAfterPrint

func (h Across) AddAfterPrint(f ...func(Printer, ...*item.FileInfo))

func (Across) AddBeforePrint

func (h Across) AddBeforePrint(f ...func(Printer, ...*item.FileInfo))

func (Across) DisablePostHook added in v0.9.0

func (h Across) DisablePostHook()

func (Across) DisablePreHook added in v0.9.0

func (h Across) DisablePreHook()

func (Across) EnablePostHook added in v0.9.0

func (h Across) EnablePostHook()

func (Across) EnablePreHook added in v0.9.0

func (h Across) EnablePreHook()

func (*Across) Print

func (a *Across) Print(items ...*item.FileInfo)

type Byline

type Byline struct {
	*bufio.Writer
	// contains filtered or unexported fields
}

func (Byline) AddAfterPrint

func (h Byline) AddAfterPrint(f ...func(Printer, ...*item.FileInfo))

func (Byline) AddBeforePrint

func (h Byline) AddBeforePrint(f ...func(Printer, ...*item.FileInfo))

func (Byline) DisablePostHook added in v0.9.0

func (h Byline) DisablePostHook()

func (Byline) DisablePreHook added in v0.9.0

func (h Byline) DisablePreHook()

func (Byline) EnablePostHook added in v0.9.0

func (h Byline) EnablePostHook()

func (Byline) EnablePreHook added in v0.9.0

func (h Byline) EnablePreHook()

func (*Byline) Print

func (b *Byline) Print(i ...*item.FileInfo)

type CSVPrinter added in v0.8.0

type CSVPrinter struct {
	*TablePrinter
}

func (CSVPrinter) AddAfterPrint added in v0.8.0

func (h CSVPrinter) AddAfterPrint(f ...func(Printer, ...*item.FileInfo))

func (CSVPrinter) AddBeforePrint added in v0.8.0

func (h CSVPrinter) AddBeforePrint(f ...func(Printer, ...*item.FileInfo))

func (CSVPrinter) DisablePostHook added in v0.9.0

func (h CSVPrinter) DisablePostHook()

func (CSVPrinter) DisablePreHook added in v0.9.0

func (h CSVPrinter) DisablePreHook()

func (CSVPrinter) EnablePostHook added in v0.9.0

func (h CSVPrinter) EnablePostHook()

func (CSVPrinter) EnablePreHook added in v0.9.0

func (h CSVPrinter) EnablePreHook()

func (*CSVPrinter) Print added in v0.8.0

func (c *CSVPrinter) Print(s ...*item.FileInfo)

type CommaPrint

type CommaPrint struct {
	*Across
	// contains filtered or unexported fields
}

func (CommaPrint) AddAfterPrint

func (h CommaPrint) AddAfterPrint(f ...func(Printer, ...*item.FileInfo))

func (CommaPrint) AddBeforePrint

func (h CommaPrint) AddBeforePrint(f ...func(Printer, ...*item.FileInfo))

func (CommaPrint) DisablePostHook added in v0.9.0

func (h CommaPrint) DisablePostHook()

func (CommaPrint) DisablePreHook added in v0.9.0

func (h CommaPrint) DisablePreHook()

func (CommaPrint) EnablePostHook added in v0.9.0

func (h CommaPrint) EnablePostHook()

func (CommaPrint) EnablePreHook added in v0.9.0

func (h CommaPrint) EnablePreHook()

func (*CommaPrint) Print

func (c *CommaPrint) Print(items ...*item.FileInfo)

type Content

type Content interface {
	String() string
}

type FitTerminal

type FitTerminal struct {
	*bufio.Writer
	// contains filtered or unexported fields
}

func (FitTerminal) AddAfterPrint

func (h FitTerminal) AddAfterPrint(f ...func(Printer, ...*item.FileInfo))

func (FitTerminal) AddBeforePrint

func (h FitTerminal) AddBeforePrint(f ...func(Printer, ...*item.FileInfo))

func (FitTerminal) DisablePostHook added in v0.9.0

func (h FitTerminal) DisablePostHook()

func (FitTerminal) DisablePreHook added in v0.9.0

func (h FitTerminal) DisablePreHook()

func (FitTerminal) EnablePostHook added in v0.9.0

func (h FitTerminal) EnablePostHook()

func (FitTerminal) EnablePreHook added in v0.9.0

func (h FitTerminal) EnablePreHook()

func (*FitTerminal) Print

func (f *FitTerminal) Print(i ...*item.FileInfo)

type HTMLPrinter added in v0.8.0

type HTMLPrinter struct {
	*TablePrinter
}

func (HTMLPrinter) AddAfterPrint added in v0.8.0

func (h HTMLPrinter) AddAfterPrint(f ...func(Printer, ...*item.FileInfo))

func (HTMLPrinter) AddBeforePrint added in v0.8.0

func (h HTMLPrinter) AddBeforePrint(f ...func(Printer, ...*item.FileInfo))

func (HTMLPrinter) DisablePostHook added in v0.9.0

func (h HTMLPrinter) DisablePostHook()

func (HTMLPrinter) DisablePreHook added in v0.9.0

func (h HTMLPrinter) DisablePreHook()

func (HTMLPrinter) EnablePostHook added in v0.9.0

func (h HTMLPrinter) EnablePostHook()

func (HTMLPrinter) EnablePreHook added in v0.9.0

func (h HTMLPrinter) EnablePreHook()

func (*HTMLPrinter) Print added in v0.8.0

func (p *HTMLPrinter) Print(s ...*item.FileInfo)

type Hook

type Hook interface {
	AddBeforePrint(...func(Printer, ...*item.FileInfo))
	AddAfterPrint(...func(Printer, ...*item.FileInfo))
	DisablePreHook()
	EnablePreHook()
	DisablePostHook()
	EnablePostHook()
}

type ItemContent

type ItemContent struct {
	No             int
	Content        Content
	Prefix, Suffix string
}

func (*ItemContent) AddPrefix added in v0.9.0

func (i *ItemContent) AddPrefix(add string)

func (*ItemContent) AddSuffix added in v0.9.0

func (i *ItemContent) AddSuffix(add string)

func (*ItemContent) NO added in v0.9.0

func (i *ItemContent) NO() int

func (*ItemContent) SetPrefix added in v0.9.0

func (i *ItemContent) SetPrefix(s string)

func (*ItemContent) SetSuffix added in v0.9.0

func (i *ItemContent) SetSuffix(s string)

func (*ItemContent) String added in v0.9.0

func (i *ItemContent) String() string

type JsonPrinter added in v0.8.0

type JsonPrinter struct {
	*bufio.Writer

	Extra []any
	// contains filtered or unexported fields
}

func (JsonPrinter) AddAfterPrint added in v0.8.0

func (h JsonPrinter) AddAfterPrint(f ...func(Printer, ...*item.FileInfo))

func (JsonPrinter) AddBeforePrint added in v0.8.0

func (h JsonPrinter) AddBeforePrint(f ...func(Printer, ...*item.FileInfo))

func (JsonPrinter) DisablePostHook added in v0.9.0

func (h JsonPrinter) DisablePostHook()

func (JsonPrinter) DisablePreHook added in v0.9.0

func (h JsonPrinter) DisablePreHook()

func (JsonPrinter) EnablePostHook added in v0.9.0

func (h JsonPrinter) EnablePostHook()

func (JsonPrinter) EnablePreHook added in v0.9.0

func (h JsonPrinter) EnablePreHook()

func (*JsonPrinter) Print added in v0.8.0

func (j *JsonPrinter) Print(items ...*item.FileInfo)

type MDPrinter added in v0.8.0

type MDPrinter struct {
	*TablePrinter
}

func (MDPrinter) AddAfterPrint added in v0.8.0

func (h MDPrinter) AddAfterPrint(f ...func(Printer, ...*item.FileInfo))

func (MDPrinter) AddBeforePrint added in v0.8.0

func (h MDPrinter) AddBeforePrint(f ...func(Printer, ...*item.FileInfo))

func (MDPrinter) DisablePostHook added in v0.9.0

func (h MDPrinter) DisablePostHook()

func (MDPrinter) DisablePreHook added in v0.9.0

func (h MDPrinter) DisablePreHook()

func (MDPrinter) EnablePostHook added in v0.9.0

func (h MDPrinter) EnablePostHook()

func (MDPrinter) EnablePreHook added in v0.9.0

func (h MDPrinter) EnablePreHook()

func (*MDPrinter) Print added in v0.8.0

func (m *MDPrinter) Print(s ...*item.FileInfo)

type PrettyPrinter added in v0.8.0

type PrettyPrinter interface {
	SetTitle(title string)
	AddHeader(headers string)
	AddFooter(footer string)
	Printer
}

type Printer

type Printer interface {
	Print(s ...*item.FileInfo)
	Hook
	io.Writer
}

func NewAcross

func NewAcross() Printer

func NewByline

func NewByline() Printer

func NewCSVPrinter added in v0.8.0

func NewCSVPrinter() Printer

func NewCommaPrint

func NewCommaPrint() Printer

func NewFitTerminal

func NewFitTerminal() Printer

func NewHTMLPrinter added in v0.8.0

func NewHTMLPrinter() Printer

func NewJsonPrinter added in v0.8.0

func NewJsonPrinter() Printer

func NewMDPrinter added in v0.8.0

func NewMDPrinter() Printer

func NewTablePrinter added in v0.8.0

func NewTablePrinter(opts ...func(writer table.Writer)) Printer

func NewZero

func NewZero() Printer

type StringContent

type StringContent string

func (StringContent) String

func (s StringContent) String() string

type TablePrinter added in v0.8.0

type TablePrinter struct {
	*bufio.Writer
	// contains filtered or unexported fields
}

func (TablePrinter) AddAfterPrint added in v0.8.0

func (h TablePrinter) AddAfterPrint(f ...func(Printer, ...*item.FileInfo))

func (TablePrinter) AddBeforePrint added in v0.8.0

func (h TablePrinter) AddBeforePrint(f ...func(Printer, ...*item.FileInfo))

func (*TablePrinter) AddFooter added in v0.8.0

func (t *TablePrinter) AddFooter(footer string)

func (*TablePrinter) AddHeader added in v0.8.0

func (t *TablePrinter) AddHeader(headers string)

func (TablePrinter) DisablePostHook added in v0.9.0

func (h TablePrinter) DisablePostHook()

func (TablePrinter) DisablePreHook added in v0.9.0

func (h TablePrinter) DisablePreHook()

func (TablePrinter) EnablePostHook added in v0.9.0

func (h TablePrinter) EnablePostHook()

func (TablePrinter) EnablePreHook added in v0.9.0

func (h TablePrinter) EnablePreHook()

func (*TablePrinter) Print added in v0.8.0

func (t *TablePrinter) Print(s ...*item.FileInfo)

func (*TablePrinter) PrintBase added in v0.8.0

func (t *TablePrinter) PrintBase(fn func() string, s ...*item.FileInfo)

func (*TablePrinter) SetTitle added in v0.8.0

func (t *TablePrinter) SetTitle(title string)

type TreePrinter added in v0.11.0

type TreePrinter struct {
	*bufio.Writer

	NO bool
	// contains filtered or unexported fields
}

func NewTreePrinter added in v0.11.0

func NewTreePrinter() *TreePrinter

func (TreePrinter) AddAfterPrint added in v0.11.0

func (h TreePrinter) AddAfterPrint(f ...func(Printer, ...*item.FileInfo))

func (TreePrinter) AddBeforePrint added in v0.11.0

func (h TreePrinter) AddBeforePrint(f ...func(Printer, ...*item.FileInfo))

func (TreePrinter) DisablePostHook added in v0.11.0

func (h TreePrinter) DisablePostHook()

func (TreePrinter) DisablePreHook added in v0.11.0

func (h TreePrinter) DisablePreHook()

func (TreePrinter) EnablePostHook added in v0.11.0

func (h TreePrinter) EnablePostHook()

func (TreePrinter) EnablePreHook added in v0.11.0

func (h TreePrinter) EnablePreHook()

func (*TreePrinter) Print added in v0.11.0

func (t *TreePrinter) Print(s ...*item.FileInfo)

type Zero

type Zero struct {
	*bufio.Writer
	// contains filtered or unexported fields
}

func (Zero) AddAfterPrint

func (h Zero) AddAfterPrint(f ...func(Printer, ...*item.FileInfo))

func (Zero) AddBeforePrint

func (h Zero) AddBeforePrint(f ...func(Printer, ...*item.FileInfo))

func (Zero) DisablePostHook added in v0.9.0

func (h Zero) DisablePostHook()

func (Zero) DisablePreHook added in v0.9.0

func (h Zero) DisablePreHook()

func (Zero) EnablePostHook added in v0.9.0

func (h Zero) EnablePostHook()

func (Zero) EnablePreHook added in v0.9.0

func (h Zero) EnablePreHook()

func (*Zero) Print

func (z *Zero) Print(items ...*item.FileInfo)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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