Documentation
¶
Overview ¶
Package humanbytes is used to convert bytes to and from human readable representations. It can convert a string such as '1 MB' into bytes. Convert bytes to another unit eg KB, MB, GB... and also generate a human readable representation of the bytes e.g. 1024 would be displayed as '1 KB'.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Convert ¶
Convert takes the number of bytes and converts it to the equivalent in the unit identified by the type string parameter e.g. 'KB' or 'MB'
func ConvertToBytes ¶
ConvertToBytes takes a value in the specified unit and converts it to bytes
func ParseBytes ¶
ParseBytes takes a string with a unit prefix (e.g. MB) and converts the value to bytes
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.