print

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTable

func CreateTable(
	options PrintTableOptions,
	defaultHeaders []string,
	taskHeaders []string,
) table.Writer

func FormatTable

func FormatTable(theme dao.Theme) table.Style

func GetAlign

func GetAlign(s string) text.Align

Align map against go-pretty/table

func GetAttr

func GetAttr(s string) *text.Color

Attr (color) map against go-pretty/table (attributes belong to the same types as fg/bg)

func GetBg

func GetBg(s string) *text.Color

Background color map against go-pretty/table

func GetFg

func GetFg(s string) *text.Color

Foreground color map against go-pretty/table

func GetFormat

func GetFormat(s string) text.Format

Format map against go-pretty/table

func PrintServerBlocks

func PrintServerBlocks(servers []dao.Server)

func PrintTable

func PrintTable[T Items](
	title string,
	data []T,
	options PrintTableOptions,
	defaultHeaders []string,
	taskHeaders []string,
)

func PrintTaskBlock

func PrintTaskBlock(tasks []dao.Task)

func RenderTable

func RenderTable(t table.Writer, output string)

Types

type Items

type Items interface {
	GetValue(string, int) string
}

type PrintTableOptions

type PrintTableOptions struct {
	Output               string
	Theme                dao.Theme
	OmitEmpty            bool
	SuppressEmptyColumns bool
}

Jump to

Keyboard shortcuts

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