print

package
v0.15.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FailedPrint = text.Colors{text.Reset, text.FgRed}
View Source
var IgnoredPrint = text.Colors{text.Reset, text.FgMagenta}
View Source
var NormalPrint = text.Colors{text.Reset}
View Source
var SkippedPrint = text.Colors{text.Reset, text.FgBlue}
View Source
var UnreachablePrint = text.Colors{text.Reset, text.FgRed}
View Source
var ZeroPrint = text.Colors{text.Reset, text.Faint}

Functions

func CreateTable

func CreateTable(
	options PrintTableOptions,
	tableHeaders []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 PrintExitReport added in v0.13.0

func PrintExitReport(
	theme *dao.Theme,
	options PrintTableOptions,
	reportData dao.ReportData,
) error
               Return Code
Server      Output-0  Output-1  Output-2

------------------------------------------

list-0      1
list-1      0         1
list-2      1
list-3      0         0         0
list-4      0         0         0

func PrintProfileReport added in v0.13.0

func PrintProfileReport(
	theme *dao.Theme,
	options PrintTableOptions,
	reportData dao.ReportData,
) error
Server  Output-0  Output-1  Output-2

--------------------------------------

list-0  0.05 s    0.00 s    0.00 s
list-1  1.05 s    0.01 s    0.00 s
list-2  0.01 s    0.00 s    0.00 s
list-3  1.01 s    0.00 s    0.00 s
list-4  1.01 s    0.00 s    0.00 s

func PrintReport added in v0.13.0

func PrintReport(
	theme *dao.Theme,
	reportData dao.ReportData,
	spec dao.Spec,
) error

TODO: Support csv,html,json,markdown

func PrintServerBlocks

func PrintServerBlocks(servers []dao.Server)

func PrintServerList added in v0.13.0

func PrintServerList(servers []dao.Server) error

func PrintSpecBlocks added in v0.12.0

func PrintSpecBlocks(specs []dao.Spec, indent bool)

func PrintSummaryReport added in v0.13.0

func PrintSummaryReport(
	theme *dao.Theme,
	options PrintTableOptions,
	reportData dao.ReportData,
) error
Summary

Server Ok Ignored Failed Skipped ------------------------------------------------- list-0 ok=2 ignored=1 failed=0 skipped=0 list-1 ok=2 ignored=1 failed=0 skipped=0 list-2 ok=1 ignored=2 failed=0 skipped=0 list-3 ok=3 ignored=0 failed=0 skipped=0 list-4 ok=3 ignored=0 failed=0 skipped=0

func PrintTable

func PrintTable[T dao.Items](
	data []T,
	options PrintTableOptions,
	headers []string,
	footers []string,
	padTop bool,
	padBottom bool,
) error

func PrintTargetBlocks added in v0.12.0

func PrintTargetBlocks(targets []dao.Target, indent bool)

func PrintTaskBlock

func PrintTaskBlock(tasks []dao.Task)

func PrintTaskReport added in v0.13.0

func PrintTaskReport(
	theme *dao.Theme,
	options PrintTableOptions,
	reportData dao.ReportData,
) error
                  Task
Server      Output-0  Output-1  Output-2

------------------------------------------

list-0      ignored   ok        ok
list-1      ok        ignored   ok
list-2      ignored   ignored   ok
list-3      ok        ok        ok
list-4      ok        ok        ok

func RenderTable

func RenderTable(
	t table.Writer,
	output string,
	padTop bool,
	padBottom bool,
)

Types

type PrintTableOptions

type PrintTableOptions struct {
	Title            string
	Output           string
	Theme            dao.Theme
	Resource         string
	OmitEmptyRows    bool
	OmitEmptyColumns bool
}

Jump to

Keyboard shortcuts

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