datasize

package
v0.4.15 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B   bitSize = 8
	KiB         = B << 10
	MiB         = KiB << 10
	GiB         = MiB << 10
	TiB         = GiB << 10
	PiB         = TiB << 10
	EiB         = PiB << 10

	KB = B * 1000
	MB = KB * 1000
	GB = MB * 1000
	TB = GB * 1000
	PB = TB * 1000
	EB = PB * 1000

	Kibit = bit << 10
	Mibit = Kibit << 10
	Gibit = Mibit << 10
	Tibit = Gibit << 10
	Pibit = Tibit << 10
	Eibit = Pibit << 10

	Mbit = kbit * 1000
	Gbit = Mbit * 1000
	Tbit = Gbit * 1000
	Pbit = Tbit * 1000
	Ebit = Pbit * 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BitRate

type BitRate struct {
	// contains filtered or unexported fields
}

func NewBitRate

func NewBitRate(bitsPerSec uint64) BitRate

func (BitRate) Bits

func (b BitRate) Bits() uint64

func (BitRate) Bytes

func (b BitRate) Bytes() float64

func (BitRate) EBits

func (b BitRate) EBits() float64

func (BitRate) EBytes

func (b BitRate) EBytes() float64

func (BitRate) EiBits

func (b BitRate) EiBits() float64

func (BitRate) EiBytes

func (b BitRate) EiBytes() float64

func (BitRate) GBits

func (b BitRate) GBits() float64

func (BitRate) GBytes

func (b BitRate) GBytes() float64

func (BitRate) GiBits

func (b BitRate) GiBits() float64

func (BitRate) GiBytes

func (b BitRate) GiBytes() float64

func (BitRate) HumanReadable

func (d BitRate) HumanReadable() string

func (BitRate) HumanReadableBin

func (d BitRate) HumanReadableBin() string

func (BitRate) HumanReadableDec

func (d BitRate) HumanReadableDec() string

func (BitRate) HumanReadableString

func (b BitRate) HumanReadableString(flags uint8) string

func (BitRate) KBits

func (b BitRate) KBits() float64

func (BitRate) KBytes

func (b BitRate) KBytes() float64

func (BitRate) KiBytes

func (b BitRate) KiBytes() float64

func (BitRate) Kibits

func (b BitRate) Kibits() float64

func (BitRate) MBytes

func (b BitRate) MBytes() float64

func (BitRate) MarshalText

func (d BitRate) MarshalText() ([]byte, error)

func (BitRate) Mbits

func (b BitRate) Mbits() float64

func (BitRate) MiBytes

func (b BitRate) MiBytes() float64

func (BitRate) Mibits

func (b BitRate) Mibits() float64

func (BitRate) PBits

func (b BitRate) PBits() float64

func (BitRate) PBytes

func (b BitRate) PBytes() float64

func (BitRate) PiBits

func (b BitRate) PiBits() float64

func (BitRate) PiBytes

func (b BitRate) PiBytes() float64

func (BitRate) PreciseString

func (b BitRate) PreciseString(flags uint8) string

func (BitRate) TBits

func (b BitRate) TBits() float64

func (BitRate) TBytes

func (b BitRate) TBytes() float64

func (BitRate) TiBits

func (b BitRate) TiBits() float64

func (BitRate) TiBytes

func (b BitRate) TiBytes() float64

func (*BitRate) Unmarshal

func (b *BitRate) Unmarshal(size interface{}, dimension string, flags uint8) error

func (*BitRate) UnmarshalText

func (d *BitRate) UnmarshalText(text []byte) error

type ByteSize

type ByteSize struct {
	// contains filtered or unexported fields
}

func NewByteSize

func NewByteSize(bytes uint64) ByteSize

func (ByteSize) Bits

func (b ByteSize) Bits() uint64

func (ByteSize) Bytes

func (b ByteSize) Bytes() uint64

func (ByteSize) EBits

func (b ByteSize) EBits() float64

func (ByteSize) EBytes

func (b ByteSize) EBytes() float64

func (ByteSize) EiBits

func (b ByteSize) EiBits() float64

func (ByteSize) EiBytes

func (b ByteSize) EiBytes() float64

func (ByteSize) GBits

func (b ByteSize) GBits() float64

func (ByteSize) GBytes

func (b ByteSize) GBytes() float64

func (ByteSize) GiBits

func (b ByteSize) GiBits() float64

func (ByteSize) GiBytes

func (b ByteSize) GiBytes() float64

func (ByteSize) HumanReadable

func (d ByteSize) HumanReadable() string

func (ByteSize) HumanReadableBin

func (d ByteSize) HumanReadableBin() string

func (ByteSize) HumanReadableDec

func (d ByteSize) HumanReadableDec() string

func (ByteSize) HumanReadableString

func (b ByteSize) HumanReadableString(flags uint8) string

func (ByteSize) KBits

func (b ByteSize) KBits() float64

func (ByteSize) KBytes

func (b ByteSize) KBytes() float64

func (ByteSize) KiBytes

func (b ByteSize) KiBytes() float64

func (ByteSize) Kibits

func (b ByteSize) Kibits() float64

func (ByteSize) MBytes

func (b ByteSize) MBytes() float64

func (ByteSize) MarshalText

func (d ByteSize) MarshalText() ([]byte, error)

func (ByteSize) Mbits

func (b ByteSize) Mbits() float64

func (ByteSize) MiBytes

func (b ByteSize) MiBytes() float64

func (ByteSize) Mibits

func (b ByteSize) Mibits() float64

func (ByteSize) PBits

func (b ByteSize) PBits() float64

func (ByteSize) PBytes

func (b ByteSize) PBytes() float64

func (ByteSize) PiBits

func (b ByteSize) PiBits() float64

func (ByteSize) PiBytes

func (b ByteSize) PiBytes() float64

func (ByteSize) PreciseString

func (b ByteSize) PreciseString(flags uint8) string

func (ByteSize) TBits

func (b ByteSize) TBits() float64

func (ByteSize) TBytes

func (b ByteSize) TBytes() float64

func (ByteSize) TiBits

func (b ByteSize) TiBits() float64

func (ByteSize) TiBytes

func (b ByteSize) TiBytes() float64

func (*ByteSize) Unmarshal

func (b *ByteSize) Unmarshal(size interface{}, dimension string, flags uint8) error

func (*ByteSize) UnmarshalText

func (d *ByteSize) UnmarshalText(text []byte) error

type Dimension

type Dimension struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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