console

package
v0.0.0-...-df8bdf0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package console contains code to pretty-print different types to the console.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration

func FormatDuration(d time.Duration) string

FormatDuration returns a formatted time.Duration in the format of h:mm.

func PrintCalendarMonth

func PrintCalendarMonth(month time.Time, cal *personio.AttendanceCalendar)

func UsageTemplate

func UsageTemplate() string

UsageTemplate returns a lightly colored usage template for Cobra.

Types

type Table

type Table struct {
	// contains filtered or unexported fields
}

func (*Table) CommitRow

func (t *Table) CommitRow()

func (*Table) Fprintln

func (t *Table) Fprintln(w io.Writer)

func (*Table) Println

func (t *Table) Println()

func (*Table) Rows

func (t *Table) Rows() int

func (*Table) SetPrefix

func (t *Table) SetPrefix(prefix string)

func (*Table) SetSpacing

func (t *Table) SetSpacing(spacing string)

func (*Table) WidestCellWidth

func (t *Table) WidestCellWidth() int

func (*Table) Width

func (t *Table) Width() int

func (*Table) WriteCell

func (t *Table) WriteCell(s string)

func (*Table) WriteCellColor

func (t *Table) WriteCellColor(s string, c *color.Color)

func (*Table) WriteCellWidth

func (t *Table) WriteCellWidth(s string, width int)

func (*Table) WriteColoredRow

func (t *Table) WriteColoredRow(c *color.Color, headers ...string)

Jump to

Keyboard shortcuts

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