gvolume

package
v0.0.0-...-04ff805 Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KB = Volume(gspeed.KB)
	MB = Volume(gspeed.MB)
	GB = Volume(gspeed.GB)
	TB = Volume(gspeed.TB)
	PB = Volume(gspeed.PB)
	EB = Volume(gspeed.EB)
	ZB = Volume(gspeed.ZB)
	YB = Volume(gspeed.YB)

	Zero = Volume(0)
)

Map between speed unit of byte and bits size

Variables

This section is empty.

Functions

This section is empty.

Types

type Volume

type Volume gspeed.Speed

func FromByteSize

func FromByteSize(size float64) (Volume, error)

func FromByteSizeUint64

func FromByteSizeUint64(size uint64) Volume

func ParseString

func ParseString(volume string) (Volume, error)

volume string sample: "2M" "2MB" "2Mbyte" "2Mbytes"

func (Volume) Add

func (v Volume) Add(v2 Volume) Volume

func (Volume) Bits

func (v Volume) Bits() float64

func (Volume) Bytes

func (v Volume) Bytes() uint64

func (*Volume) Equals

func (v *Volume) Equals(v2 Volume) bool

func (*Volume) GreaterThan

func (v *Volume) GreaterThan(v2 Volume) bool

func (*Volume) GreaterThanOrEqual

func (v *Volume) GreaterThanOrEqual(v2 Volume) bool

func (*Volume) LessThan

func (v *Volume) LessThan(v2 Volume) bool

func (*Volume) LessThanOrEqual

func (v *Volume) LessThanOrEqual(v2 Volume) bool

func (Volume) MBytes

func (v Volume) MBytes() float64

func (Volume) MarshalJSON

func (v Volume) MarshalJSON() ([]byte, error)

func (Volume) Mul

func (v Volume) Mul(n uint64) Volume

func (Volume) String

func (v Volume) String() string

func (Volume) Sub

func (v Volume) Sub(v2 Volume) Volume

func (*Volume) UnmarshalJSON

func (v *Volume) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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