units

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package units contains helpers to convert sizes to human-readable strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesPerSecondsString added in v0.9.6

func BytesPerSecondsString(bps float64) string

BytesPerSecondsString formats the given value bytes per second with the appropriate base-10 suffix (KB/s, MB/s, GB/s, ...)

func BytesString added in v0.13.0

func BytesString(b int64) string

BytesString formats the given value as bytes with the unit provided from the environment.

func BytesStringBase10

func BytesStringBase10(b int64) string

BytesStringBase10 formats the given value as bytes with the appropriate base-10 suffix (KB, MB, GB, ...)

func BytesStringBase2

func BytesStringBase2(b int64) string

BytesStringBase2 formats the given value as bytes with the appropriate base-2 suffix (KiB, MiB, GiB, ...)

func Count

func Count(v int64) string

Count returns the given number with the appropriate base-10 suffix (K, M, G, ...)

Types

This section is empty.

Jump to

Keyboard shortcuts

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