formatter

package
v0.0.0-...-b313b0a Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BoldStyle = lipgloss.NewStyle().
	Bold(true).
	Underline(true)

Functions

func ByteCountSI

func ByteCountSI(b uint64) string

ByteCountSI presents a human friendly representation of a byte count. See https://yourbasic.org/golang/formatting-byte-size-to-human-readable-format.

func CreateProgressbar

func CreateProgressbar(length int, title string) *progressbar.ProgressBar

CreateProgressbar generates a progress bar

func CreateTable

func CreateTable() (*table.Table, error)

CreateTable prepares a table layout for output.

func HumanDuration

func HumanDuration(timestamp int64) string

HumanDuration from docker/cli RunningFor() to be accessible outside of the class

func RemoveSha

func RemoveSha(str string) string

RemoveSha remove image sha from a string that are added in some docker outputs

func ShortenID

func ShortenID(str string) string

func SmallSHA

func SmallSHA(hash string) string

func StripTagMeta

func StripTagMeta(image string) string

StripTagMeta strips front-matter image tag data that we don't need for parsing.

func ToJSON

func ToJSON(headers []string, rows [][]string) (string, error)

ToJSON converts a lipgloss.Table to JSON representation. It's not a robust implementation and mainly caters for our current use case which is basically a bunch of strings. See https://github.com/charmbracelet/lipgloss/issues/335 for the real thing (hopefully).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳