Documentation ¶
Index ¶
Constants ¶
View Source
const ( KiloByte = 1000 // kB KibiByte = 1024 // KiB MegaByte = 1000 * 1000 // MB MebiByte = 1024 * 1024 // MiB GigaByte = 1000 * 1000 * 1000 // GB GibiByte = 1024 * 1024 * 1024 // GiB TeraByte = 1000 * 1000 * 1000 * 1000 // TB TebiByte = 1024 * 1024 * 1024 * 1024 // TiB // shorthands KiB = KibiByte MB = MegaByte MiB = MebiByte GB = GigaByte GiB = GibiByte TiB = TebiByte )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Size ¶ added in v0.101.0
type Size uint64
Size is a wrapper around uint64 with support for reading from string yaml/toml, so {"size": 123}, {"size": "1234"}, {"size": "1 GiB"} are all supported
func (Size) Uint64 ¶ added in v0.101.0
Uint64 returns the size as uint64. This is a convenience functions, it is strictly equivalent to uint64(Size(1))
func (*Size) UnmarshalJSON ¶ added in v0.101.0
func (*Size) UnmarshalTOML ¶ added in v0.101.0
Click to show internal directories.
Click to hide internal directories.