zsize

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Size

type Size int64
const (
	Byte     Size = 1
	Kilobyte Size = 1000
	Kibibyte Size = 1024
	Megabyte Size = Kilobyte * Kilobyte
	Mebibyte Size = Kibibyte * Kibibyte
	Gigabyte Size = Megabyte * Kilobyte
	GibiByte Size = Mebibyte * Kibibyte
	Terabyte Size = Gigabyte * Kilobyte
	Tebibyte Size = GibiByte * Kibibyte
	Petabyte Size = Terabyte * Kilobyte
	Pebibyte Size = Tebibyte * Kibibyte
	Exabyte  Size = Petabyte * Kilobyte
)

func Parse

func Parse(val string) (res Size, err error)

Convert a human readable string value into a Size

func (Size) Formatted

func (s Size) Formatted() string

Return the formatted string

func (*Size) Set

func (s *Size) Set(val string) (err error)

Set the value of Size by parsing a string value

func (Size) String

func (s Size) String() string

Return the underlying integer value as a string

Jump to

Keyboard shortcuts

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