size

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ByteUnit = []string{"", "K", "M", "G", "T", "P"}
)

Functions

This section is empty.

Types

type ByteSize

type ByteSize uint64

func ParseFromString

func ParseFromString(str string) (size ByteSize, err error)

func (ByteSize) GB

func (s ByteSize) GB() ByteSizeUnit

func (ByteSize) GiB

func (s ByteSize) GiB() ByteSizeUnit

func (ByteSize) KB

func (s ByteSize) KB() ByteSizeUnit

func (ByteSize) KiB

func (s ByteSize) KiB() ByteSizeUnit

func (ByteSize) MB

func (s ByteSize) MB() ByteSizeUnit

func (ByteSize) MiB

func (s ByteSize) MiB() ByteSizeUnit

func (ByteSize) PB

func (s ByteSize) PB() ByteSizeUnit

func (ByteSize) PiB

func (s ByteSize) PiB() ByteSizeUnit

func (ByteSize) TB

func (s ByteSize) TB() ByteSizeUnit

func (ByteSize) TiB

func (s ByteSize) TiB() ByteSizeUnit

type ByteSizeUnit

type ByteSizeUnit struct {
	Size float64
	Unit string
}

func (ByteSizeUnit) String

func (b ByteSizeUnit) String() string

Jump to

Keyboard shortcuts

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