Documentation ¶
Index ¶
- Constants
- type Bytes
- func (b Bytes) Exabytes() float64
- func (b Bytes) Gigabytes() float64
- func (b Bytes) HumanReadable() string
- func (b Bytes) Kilobytes() float64
- func (b Bytes) MarshalText() ([]byte, error)
- func (b Bytes) Megabytes() float64
- func (b Bytes) Petabytes() float64
- func (b Bytes) String() string
- func (b Bytes) Terabytes() float64
- func (b *Bytes) UnmarshalText(data []byte) error
Constants ¶
View Source
const ( Kilobyte = 1000 * Byte Megabyte = 1000 * Kilobyte Gigabyte = 1000 * Megabyte Terabyte = 1000 * Gigabyte Petabyte = 1000 * Terabyte Exabyte = 1000 * Petabyte )
Metric system representation
View Source
const ( Kibibyte = 1024 * Byte Mebibyte = 1024 * Kibibyte Gibibyte = 1024 * Mebibyte Tebibyte = 1024 * Gibibyte Pebibyte = 1024 * Tebibyte Exbibyte = 1024 * Pebibyte )
IEC system representation.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bytes ¶
type Bytes int64
Bytes is the multiple-byte unit.
const Byte Bytes = 1
Byte is the lowest byte unit.
func ParseBytes ¶
ParseBytes parses a unit string. Valid time units are "B", "kB", "KB", "MB", "GB", "TB", "PB", "EB", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB" nolint: gocognit
func (Bytes) HumanReadable ¶
HumanReadable gets the human-readable
func (Bytes) MarshalText ¶
MarshalText implements encoding.TextMarshaler interface.
func (*Bytes) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler interface.
Click to show internal directories.
Click to hide internal directories.