Documentation ¶
Index ¶
- Constants
- func BSize(size float64) string
- func BSizeCompact(f float64) string
- func BSizeCompactFromMB(n uint64) string
- func BSizeWithPrecision(size float64, precision int) string
- func CustomExactSize(format string, precision int, size float64, base float64, _map []string) string
- func CustomSize(format string, precision int, size float64, base float64, _map []string) string
- func DSize(size float64) string
- func DSizeWithPrecision(size float64, precision int) string
- func ExactBSizeCompact(f float64) string
- func ExactDSizeCompact(f float64) string
- func FromDSize(size string) (int64, error)
- func FromSize(sizeStr string) (int64, error)
Constants ¶
View Source
const ( // KB is KiloByte KB = 1000 // MB is MegaByte MB = 1000 * KB // GB is GigaByte GB = 1000 * MB // TB is TeraByte TB = 1000 * GB // PB is PetaByte PB = 1000 * TB // EB is ExaByte EB = 1000 * PB // KiB is KibiByte KiB = 1024 // MiB is MibiByte MiB = 1024 * KiB // GiB is GibiByte GiB = 1024 * MiB // TiB is TibiByte TiB = 1024 * GiB // PiB is Pebibyte PiB = 1024 * TiB // EiB is Exbibyte EiB = 1024 * PiB )
Variables ¶
This section is empty.
Functions ¶
func BSize ¶
BSize returns a human-readable, default precision, representation of size in binary units.
func BSizeCompact ¶
BSizeCompact returns a compact human readable version of n
func BSizeCompactFromMB ¶
BSizeCompactFromMB returns a compact human readable version of n
func BSizeWithPrecision ¶
BSizeWithPrecision returns a human-readable, arbitrary precision, representation of size in binary units.
func CustomExactSize ¶
func CustomSize ¶
CustomSize returns a human-readable approximation of a size using custom format and precision.
func DSizeWithPrecision ¶
DSizeWithPrecision returns a human-readable, arbitrary precision, representation of size in SI units.
func ExactBSizeCompact ¶
func ExactDSizeCompact ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.