size

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 1 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 uint64

Size is a size type

const (
	// B is 1 byte
	B Size = 1 << (iota * 10)
	// KB is 1024 bytes
	KB
	// MB is 1024 * 1024 bytes
	MB
	// GB is 1024 * 1024 * 1024 bytes
	GB
	// TB is 1024 * 1024 * 1024 * 1024 bytes
	TB
	// PB is 1024 * 1024 * 1024 * 1024 * 1024 bytes
	PB
	// EB is 1024 * 1024 * 1024 * 1024 * 1024 * 1024 bytes
	EB
)

func (Size) BString

func (s Size) BString() string

BString returns the size as a string in bytes

func (Size) Bytes

func (s Size) Bytes() uint64

Bytes return the size in bytes

func (Size) EB

func (s Size) EB() float64

EB returns the size in exabytes

func (Size) EBString

func (s Size) EBString() string

EBString returns the size as a string in exabytes

func (Size) GB

func (s Size) GB() float64

GB returns the size in gigabytes

func (Size) GBString

func (s Size) GBString() string

GBString returns the size as a string in gigabytes

func (Size) KB

func (s Size) KB() float64

KB returns the size in kilobytes

func (Size) KBString

func (s Size) KBString() string

KBString returns the size as a string in kilobytes

func (Size) MB

func (s Size) MB() float64

MB returns the size in megabytes

func (Size) MBString

func (s Size) MBString() string

MBString returns the size as a string in megabytes

func (Size) PB

func (s Size) PB() float64

PB returns the size in petabytes

func (Size) PBString

func (s Size) PBString() string

PBString returns the size as a string in petabytes

func (Size) String

func (s Size) String() string

String returns the size as a string

func (Size) TB

func (s Size) TB() float64

TB returns the size in terabytes

func (Size) TBString

func (s Size) TBString() string

TBString returns the size as a string in terabytes

Jump to

Keyboard shortcuts

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