unitconv

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KB uint64 = 1000
	MB        = KB * 1000
	GB        = MB * 1000
	TB        = GB * 1000
	PB        = TB * 1000
	EB        = PB * 1000
)
View Source
const (
	KiB uint64 = 1024
	MiB        = KiB * 1024
	GiB        = MiB * 1024
	TiB        = GiB * 1024
	PiB        = TiB * 1024
	EiB        = PiB * 1024
)

Variables

This section is empty.

Functions

func CGroupStringToSizeInBytes

func CGroupStringToSizeInBytes(cs string) (uint64, error)

func Minimize

func Minimize(unitName string) string

func MinimizedStringToSizeInBytes

func MinimizedStringToSizeInBytes(sz string) (uint64, error)

func NarrowSize

func NarrowSize(size uint64) (uint64, string)

func SizeInBytesToCGroupString

func SizeInBytesToCGroupString(sizeInBytes uint64) string

func SizeInBytesToMinimizedString

func SizeInBytesToMinimizedString(sizeInBytes uint64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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