dataunit

package
Version: v2.5.2-0...-f3a5e34 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Byte     Size = 1
	Kilobyte      = 1024 * Byte
	Megabyte      = 1024 * Kilobyte
	Gigabyte      = 1024 * Megabyte
	Terabyte      = 1024 * Gigabyte
	Petabyte      = 1024 * Terabyte
	Exabyte       = 1024 * Petabyte
)

Common size units

Variables

This section is empty.

Functions

This section is empty.

Types

type Size

type Size int64

Size represents a measurement of data and can return that measurement in different units (B, KB, MB, GB, TB, PB, EB)

func (Size) Bytes

func (s Size) Bytes() int64

Bytes returns the size as a uint64 of bytes

func (Size) Exabytes

func (s Size) Exabytes() float64

Exabytes returns the size as a float64 of exabytes

func (Size) Gigabytes

func (s Size) Gigabytes() float64

Gigabytes returns the size as a float64 of gigabytes

func (Size) Kilobytes

func (s Size) Kilobytes() float64

Kilobytes returns the size as a float64 of kilobytes

func (Size) Megabytes

func (s Size) Megabytes() float64

Megabytes returns the size as a float64 of kilobytes

func (Size) Petabytes

func (s Size) Petabytes() float64

Petabytes returns the size as a float64 of petabytes

func (Size) Terabytes

func (s Size) Terabytes() float64

Terabytes returns the size as a float64 of terabytes

Source Files

Jump to

Keyboard shortcuts

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