writer

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Day = time.Hour * 24

Variables

This section is empty.

Functions

func MakeTable

func MakeTable(tableName []string, tableContent [][]string)

func PrintTable

func PrintTable(p Printer)

func Reshape

func Reshape(maxWidth int, line []string) []string

func TimeFormat

func TimeFormat(delta time.Duration) string

Types

type Printer

type Printer interface {
	Flags(flags ...interface{}) []interface{}
	PrintBody() [][]string
	PrintTitle() []string
	Sorter() *RecordsSorter
}

type RecordsSorter

type RecordsSorter struct {
	Records     [][]string
	CompareFunc func(row1, row2 []string) bool
}

func NewRecordsSorter

func NewRecordsSorter(cmp func([]string, []string) bool) *RecordsSorter

func (*RecordsSorter) Len

func (s *RecordsSorter) Len() int

func (*RecordsSorter) Less

func (s *RecordsSorter) Less(i, j int) bool

func (*RecordsSorter) Swap

func (s *RecordsSorter) Swap(i, j int)

Jump to

Keyboard shortcuts

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