display

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApproximateHoursPerDay   = 24
	ApproximateHoursPerWeek  = ApproximateHoursPerDay * 7
	ApproximateHoursPerMonth = ApproximateHoursPerDay * 30
	ApproximateHoursPerYear  = ApproximateHoursPerDay * 365
)

Its not important to be exact, approximations are good enough.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Header string
	Width  int
	Data   []string
}

type Duration

type Duration struct {
	Minutes int64
	Hours   int64
	Days    int64
	Weeks   int64
	Months  int64
	Years   int64
}

func NewDuration

func NewDuration(d time.Duration) Duration

func (Duration) Round

func (d Duration) Round() Duration

Round returns a new duration rounded the duration to the highest non-zero field.

func (Duration) String

func (d Duration) String() string

StringifyDuration returns a human readable string of the duration.

type Table

type Table []Column

func NewTable

func NewTable(headers ...string) Table

func (Table) AddRow

func (t Table) AddRow(data ...string) error

func (Table) String

func (t Table) String() string

Jump to

Keyboard shortcuts

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