table

package
v0.0.0-...-7b34d14 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ago

func Ago(m *time.Time, now time.Time) string

func Check

func Check(selected bool) string

func Date

func Date(t *time.Time) string

func Duration

func Duration(d time.Duration) string

Duration returns a readable representation of the provided time

func Number

func Number(v interface{}) string

func OnOff

func OnOff(on bool) string

func PaginationFooter

func PaginationFooter(list model.ResourceList) string

func TimeSince

func TimeSince(m time.Time, now time.Time) string

TimeSince to calculate age of resources

Types

type Printer

type Printer interface {
	Print(Table, io.Writer) error
}

func NewPrinter

func NewPrinter() Printer

type Table

type Table struct {
	Headers []string
	NextRow func() []string
	Footer  string
}

type TableWriter

type TableWriter interface {
	Headers(...string) error
	Row(...string) error
	Footer(string) error
	Flush() error
}

func NewWriter

func NewWriter(output io.Writer) TableWriter

Jump to

Keyboard shortcuts

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