unit

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 8 Imported by: 8

Documentation

Index

Constants

View Source
const (
	Bit      = 0.125
	BitDiv   = 8
	Byte     = 1
	KiloByte = 1000
	KiBiByte = 1 << 10
	KiloBit  = KiloByte / 8
	KiBiBit  = KiBiByte / 8
	MegaByte = 1000 * 1000
	MeBiByte = 1 << 20
	MegaBit  = MegaByte / 8
	MeBiBit  = MeBiByte / 8
	GigaByte = 1000 * 1000 * 1000
	GiBiByte = 1 << 30
	GigaBit  = GigaByte / 8
	GiBiBit  = GiBiByte / 8
	TeraByte = 1000 * 1000 * 1000 * 1000
	TeBiByte = 1 << 40
	TeraBit  = TeraByte / 8
	TeBiBit  = TeBiByte / 8
	PetaByte = 1000 * 1000 * 1000 * 1000 * 1000
	PeBiByte = 1 << 50
	PetaBit  = PetaByte / 8
	PeBiBit  = PeBiByte / 8
	ExaByte  = 1000 * 1000 * 1000 * 1000 * 1000 * 1000
	EbiByte  = 1 << 60
	ExaBit   = ExaByte / 8
	EbiBit   = EbiByte / 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Size

type Size uint64

func (Size) Float64

func (s Size) Float64() float64

func (Size) Int

func (s Size) Int() int

func (Size) Int64

func (s Size) Int64() int64

func (Size) String

func (s Size) String() string

func (Size) Uint

func (s Size) Uint() uint

func (Size) Uint64

func (s Size) Uint64() uint64

func (*Size) UnmarshalJSON

func (s *Size) UnmarshalJSON(bytes []byte) error

func (*Size) UnmarshalText

func (s *Size) UnmarshalText(text []byte) error

func (*Size) UnmarshalYAML

func (s *Size) UnmarshalYAML(value *yaml.Node) error

type UnknownSizeUnitError

type UnknownSizeUnitError struct {
	Unit string
}

func (*UnknownSizeUnitError) Error

func (e *UnknownSizeUnitError) Error() string

Jump to

Keyboard shortcuts

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