bytequantity

package
v3.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2025 License: Apache-2.0 Imports: 5 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteQuantity

type ByteQuantity struct {
	Quantity uint64
}

ByteQuantity is a data type representing a byte quantity.

func FromGiB

func FromGiB(gib uint64) ByteQuantity

FromGiB returns a byte quantity of the passed in gibibytes quantity.

func FromMiB

func FromMiB(mib uint64) ByteQuantity

FromMiB returns a byte quantity of the passed in mebibytes quantity.

func FromTiB

func FromTiB(tib uint64) ByteQuantity

FromTiB returns a byte quantity of the passed in tebibytes quantity.

func ParseToByteQuantity

func ParseToByteQuantity(byteQuantityStr string) (ByteQuantity, error)

ParseToByteQuantity parses a string representation of a byte quantity to a ByteQuantity type. A unit can be appended such as 16 GiB. If no unit is appended, GiB is assumed.

func (ByteQuantity) GiB

func (bq ByteQuantity) GiB() float64

GiB returns a byte quantity in gibibytes.

func (ByteQuantity) MiB

func (bq ByteQuantity) MiB() float64

MiB returns a byte quantity in mebibytes.

func (ByteQuantity) StringGiB

func (bq ByteQuantity) StringGiB() string

StringGiB returns a byte quantity in a gibibytes string representation.

func (ByteQuantity) StringMiB

func (bq ByteQuantity) StringMiB() string

StringMiB returns a byte quantity in a mebibytes string representation.

func (ByteQuantity) StringTiB

func (bq ByteQuantity) StringTiB() string

StringTiB returns a byte quantity in a tebibytes string representation.

func (ByteQuantity) TiB

func (bq ByteQuantity) TiB() float64

TiB returns a byte quantity in tebibytes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL