storage

package
v0.0.0-...-f57cf1e Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: ISC Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BINARY  = 1024
	DECIMAL = 1000
	BYTE    = 1

	KILOBYTE  StorageUnit = DECIMAL * BYTE
	MEGABYTE              = DECIMAL * KILOBYTE
	GIGABYTE              = DECIMAL * MEGABYTE
	TERABYTE              = DECIMAL * GIGABYTE
	PETABYTE              = DECIMAL * TERABYTE
	EXABYTE               = DECIMAL * PETABYTE
	ZETTABYTE             = DECIMAL * EXABYTE
	YOTTABYTE             = DECIMAL * ZETTABYTE

	KIBIBYTE StorageUnit = BINARY * BYTE
	MEBIBYTE             = BINARY * KIBIBYTE
	GIBIBYTE             = BINARY * MEBIBYTE
	TEBIBYTE             = BINARY * GIBIBYTE
	PEBIBYTE             = BINARY * TEBIBYTE
	EXBIBYTE             = BINARY * PEBIBYTE
	ZEBIBYTE             = BINARY * EXBIBYTE
	YOBIBYTE             = BINARY * ZEBIBYTE
)

Variables

This section is empty.

Functions

func IsStorageUnit

func IsStorageUnit[T any]() bool

Types

type StorageUnit

type StorageUnit float64

func FromAbbreviation

func FromAbbreviation(abbr string) (StorageUnit, error)

Jump to

Keyboard shortcuts

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