units

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromBytes

func FromBytes(bytes uint64) (units string, value float64)

FromBytes returns the appropriate byte unit and value for the provided number of bytes for human readability (e.g. 1024 bytes = 1 KB).

Types

type ByteUnit

type ByteUnit uint64
const (
	Bytes ByteUnit = 1 << (10 * iota)
	Kilobytes
	Megabytes
	Gigabytes
	Terabytes
)

func (ByteUnit) String

func (b ByteUnit) String() string

String returns the string representation of the byte unit.

Jump to

Keyboard shortcuts

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