bytequantity

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 5 Imported by: 4

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