display

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Output io.Writer = os.Stdout

Functions

func WidthLen

func WidthLen(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(...Item))

func (Across) AddBeforePrint

func (h Across) AddBeforePrint(f ...func(...Item))

func (*Across) Print

func (a *Across) Print(items ...Item)

type Byline

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

func (Byline) AddAfterPrint

func (h Byline) AddAfterPrint(f ...func(...Item))

func (Byline) AddBeforePrint

func (h Byline) AddBeforePrint(f ...func(...Item))

func (*Byline) Print

func (b *Byline) Print(i ...Item)

type CommaPrint

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

func (CommaPrint) AddAfterPrint

func (h CommaPrint) AddAfterPrint(f ...func(...Item))

func (CommaPrint) AddBeforePrint

func (h CommaPrint) AddBeforePrint(f ...func(...Item))

func (*CommaPrint) Print

func (c *CommaPrint) Print(items ...Item)

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(...Item))

func (FitTerminal) AddBeforePrint

func (h FitTerminal) AddBeforePrint(f ...func(...Item))

func (*FitTerminal) Print

func (f *FitTerminal) Print(i ...Item)

type Hook

type Hook interface {
	AddBeforePrint(...func(...Item))
	AddAfterPrint(...func(...Item))
}

type Item

type Item struct {
	Delimiter string
	// contains filtered or unexported fields
}

func NewItem

func NewItem(Ops ...ItemOptions) *Item

func (*Item) Del

func (i *Item) Del(key string)

func (*Item) ExcludeOrderedContent

func (i *Item) ExcludeOrderedContent(key ...string) string

ExcludeOrderedContent get content in order, exclude those match given parameter(ordered by itemContent.No, ascending)

func (*Item) Get

func (i *Item) Get(key string) (ItemContent, bool)

Get content by key

func (*Item) IncludeOrderedContent

func (i *Item) IncludeOrderedContent(names ...string) string

IncludeOrderedContent return those content inorder(ordered by itemContent.No, ascending)

func (*Item) Keys

func (i *Item) Keys() []string

Keys return all keys in random order

func (*Item) KeysByOrder

func (i *Item) KeysByOrder() []string

KeysByOrder return Keys(ordered by itemContent.No, ascending)

func (*Item) OrderedContent

func (i *Item) OrderedContent() string

OrderedContent return all content in order(ordered by itemContent.No, ascending)

func (*Item) Set

func (i *Item) Set(key string, ic ItemContent)

Set content by key

type ItemContent

type ItemContent struct {
	No      int
	Content Content
}

type ItemOptions

type ItemOptions func(*Item)

func WithDelimiter

func WithDelimiter(d string) ItemOptions

type Printer

type Printer interface {
	Print(s ...Item)
	Hook
}

func NewAcross

func NewAcross() Printer

func NewByline

func NewByline() Printer

func NewCommaPrint

func NewCommaPrint() Printer

func NewFitTerminal

func NewFitTerminal() Printer

func NewZero

func NewZero() Printer

type StringContent

type StringContent string

func (StringContent) String

func (s StringContent) String() string

type Zero

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

func (Zero) AddAfterPrint

func (h Zero) AddAfterPrint(f ...func(...Item))

func (Zero) AddBeforePrint

func (h Zero) AddBeforePrint(f ...func(...Item))

func (*Zero) Print

func (z *Zero) Print(items ...Item)

Jump to

Keyboard shortcuts

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