bytefmt

package
v0.0.0-...-e18bc7f Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BYTE = 1 << (10 * iota)
	KILOBYTE
	MEGABYTE
	GIGABYTE
	TERABYTE
	PETABYTE
)

Byte constants for every 2^(10*n) bytes

Variables

View Source
var ErrFmt errFmt

ErrFmt is returned when failing to parse human byte representations

Functions

func HumanRate

func HumanRate(size int64, duration time.Duration) string

func ToBytes

func ToBytes(s string) (uint64, error)

ToBytes transforms human byte representations to int64

func ToString

func ToString(bytes float64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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