format

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(bytes int64) string

Bytes attaches a unit to the bytes value and makes it human readable.

func Filename

func Filename(fn string, iteration int, maxLen int) string

Filename takes the given filename and rotates it like a carousel through a fixed length string of maxLen. See tests for example.

func Progress

func Progress(width int, percent float64) string

Progress builds a string of length `width` that indicates the `percent` progress being made by filled █ characters.

func Speed

func Speed(bytesPerS int64) string

Speed formats the given bytes per second value to a human readable format.

func TransferStatus

func TransferStatus(fn string, iteration int, twidth int, p float64, eta time.Duration, bytesPerS int64) string

TransferStatus takes the terminal width `twidth` and builds a string occupying the whole width indicating the current transfer status.

Types

This section is empty.

Jump to

Keyboard shortcuts

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