Documentation ¶
Index ¶
Constants ¶
View Source
const ( B = 1 << (10 * iota) KB MB GB TB PB EB )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Size ¶
type Size uint64
Size represents human-readable bytes.
func Parse ¶
Parse parses human-readable bytes string to Size. For example, 1 K/1 KB(or 1K) will return 1024 bytes.
func (Size) Format ¶
Format formats Size to human-readable string with specified options. For example, 1024 bytes will return 1 KB.
func (Size) MarshalJSON ¶
func (Size) String ¶
String formats Size to human-readable string with default options. For example, 1024 bytes will return '1 KB'.
func (*Size) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.