datasize

package
v0.0.0-...-be0919c Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2018 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Bit represents 1 bit
	Bit BitSize = 1

	// Byte is 8 bits
	Byte = 8 * Bit
	// B is short for Byte
	B = Byte

	// Kilobyte represents 1024 bytes
	Kilobyte = 1024 * Byte
	// KB is short for Kilobyte
	KB = Kilobyte

	// Megabyte represents 1024 kilobytes
	Megabyte = 1024 * Kilobyte
	// MB is short for Megabyte
	MB = Megabyte

	// Gigabyte represents 1024 megabytes
	Gigabyte = 1024 * Megabyte
	// GB is short for Gigabyte
	GB = Gigabyte

	// Terabyte represents 1024 gigabytes
	Terabyte = 1024 * Gigabyte
	// TB is short for Terabyte
	TB = Terabyte

	// Petabyte represents 1024 terabytes
	Petabyte = 1024 * Terabyte
	// PB is short for Petabyte
	PB = Petabyte

	// Exabyte represents 1024 petabytes
	Exabyte = 1024 * Petabyte
	// EB is short for Exabyte
	EB = Exabyte
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BitSize

type BitSize float64

BitSize represents data size in various units

func (BitSize) Bits

func (size BitSize) Bits() uint64

Bits returns size in bits

func (BitSize) Bytes

func (size BitSize) Bytes() float64

Bytes returns size in bytes

func (BitSize) Exabytes

func (size BitSize) Exabytes() float64

Exabytes returns size in exabytes

func (BitSize) Gigabytes

func (size BitSize) Gigabytes() float64

Gigabytes returns size in gigabytes

func (BitSize) Kilobytes

func (size BitSize) Kilobytes() float64

Kilobytes returns size in kilobytes

func (BitSize) Megabytes

func (size BitSize) Megabytes() float64

Megabytes returns size in megabytes

func (BitSize) Petabytes

func (size BitSize) Petabytes() float64

Petabytes returns size in petabytes

func (BitSize) String

func (size BitSize) String() string

String returns human-readable string representation of size

func (BitSize) Terabytes

func (size BitSize) Terabytes() float64

Terabytes returns size in terabytes

Jump to

Keyboard shortcuts

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