Documentation
¶
Overview ¶
Package bsize provides typed bytes/size handling and parsing, modeled after time.Duration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bytes ¶
type Bytes uint64
func Parse ¶
Parse parses a string of bytes size with an optional unit suffix (e.g. 1024 or 4KiB) into a number of bytes. Returns an error if the result would overflow uint64 (~16384PiB).
func (Bytes) String ¶
String returns a string representing the byte size in the form "1.5GiB". The fractional digit and decimal point are omitted when the value is an even multiple of the unit. Sizes below 1KiB format as plain bytes. The zero size formats as 0B.
func (*Bytes) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.