datasize

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// Bit represents 1 bit.
	Bit BitSize = 1
	// B is short for Byte.
	B = 8 * Bit
	// KiB is short for Kibibyte.
	KiB = 1024 * B
	// MiB is short for Mebibyte.
	MiB = 1024 * KiB
	// GiB is short for Gibibyte.
	GiB = 1024 * MiB
	// TiB is short for Tebibyte.
	TiB = 1024 * GiB
	// PiB is short for Pebibyte.
	PiB = 1024 * TiB
	// EiB is short for Exbibyte.
	EiB = 1024 * PiB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BitSize

type BitSize float64

BitSize represents data size in various units.

func FromBytes

func FromBytes(bytes uint64) BitSize

FromBytes creates BitSize from bytes value.

func (BitSize) Bits

func (size BitSize) Bits() uint64

Bits returns size in bits.

func (BitSize) Bytes

func (size BitSize) Bytes() uint64

Bytes returns size in bytes.

func (BitSize) String

func (size BitSize) String() string

String returns a human readable representation of bytes.

type BitSpeed

type BitSpeed BitSize

BitSpeed represents the data speed in bits per second.

func (BitSpeed) String

func (t BitSpeed) String() string

String returns human readable form of the throughput

Jump to

Keyboard shortcuts

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