Documentation ¶
Index ¶
Constants ¶
const ( // OffsetKiB is the byte size of one kibibyte (2^10 = 1024 bytes) OffsetKiB = Offset(1 << 10) // OffsetMiB is the offset of one mebibyte (2^20) OffsetMiB = Offset(1 << 20) )
const ( // SizeKiB is the byte size of one kibibyte (2^10 = 1024 bytes) SizeKiB = Size(1 << 10) // SizeMiB is the size of one mebibyte (2^20) SizeMiB = Size(1 << 20) // SizeGiB is the size of one gibibyte (2^30) SizeGiB = Size(1 << 30) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Offset ¶
type Offset Size
Offset describes the offset in bytes and is a thin wrapper around Size.
func ParseOffset ¶
ParseOffset parses a string expressing offset in a gadget specific format. The accepted format is one of: <bytes> | <bytes/2^20>M | <bytes/2^30>G.
func (*Offset) IECString ¶
IECString formats the offset using multiples from IEC units (i.e. kibibytes, mebibytes), that is as multiples of 1024. Printed values are truncated to 2 decimal points.
func (*Offset) UnmarshalYAML ¶
type Size ¶
type Size uint64
Size describes the size in bytes.
func ParseSize ¶
ParseSize parses a string expressing size in a gadget specific format. The accepted format is one of: <bytes> | <bytes/2^20>M | <bytes/2^30>G.
func (*Size) IECString ¶
IECString formats the size using multiples from IEC units (i.e. kibibytes, mebibytes), that is as multiples of 1024. Printed values are truncated to 2 decimal points.