printer

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 13 Imported by: 3 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	OutputConsole     = "console"
	OutputConsoleWide = "wide" // same as console, prints additional headers
	OutputYAML        = "yaml"
	OutputJSON        = "json"
)

output types

View Source
const (
	DisplayStyleRelativeTime = "relative_time"
)

Variables

This section is empty.

Functions

func FormatTimeValue added in v2.2.0

func FormatTimeValue(value time.Time, displayStyle string) string

func Print

func Print(out io.Writer, headers []Header, data interface{}, hideHeader bool, output string, pretty bool)

func PrintConsole

func PrintConsole(out io.Writer, headers []Header, data []interface{}, hideHeader, wideEnabled bool)

Types

type Header struct {
	Title        string
	ValuePath    string
	DisplayStyle string
	IsWide       bool
	ValueFunc    ValueFunc
}

type ValueFunc

type ValueFunc func(interface{}) string

Jump to

Keyboard shortcuts

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