datasize

package
v0.0.0-...-95c80d3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B  ByteSize = 1
	KB          = B * 1000
	MB          = KB * 1000
	GB          = MB * 1000
	TB          = GB * 1000
	PB          = TB * 1000
	EB          = PB * 1000
)

Variables

View Source
var ErrBits = errors.New("unit with capital unit prefix and lower case unit (b) - bits, not bytes ")

Functions

This section is empty.

Types

type ByteSize

type ByteSize uint64

func MustParse

func MustParse(t []byte) ByteSize

func MustParseString

func MustParseString(s string) ByteSize

func Parse

func Parse(t []byte) (ByteSize, error)

func ParseString

func ParseString(s string) (ByteSize, error)

func (ByteSize) Bytes

func (b ByteSize) Bytes() uint64

func (ByteSize) EBytes

func (b ByteSize) EBytes() float64

func (ByteSize) GBytes

func (b ByteSize) GBytes() float64

func (ByteSize) HR

func (b ByteSize) HR() string

func (ByteSize) HumanReadable

func (b ByteSize) HumanReadable() string

func (ByteSize) KBytes

func (b ByteSize) KBytes() float64

func (ByteSize) MBytes

func (b ByteSize) MBytes() float64

func (ByteSize) MarshalText

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

func (ByteSize) PBytes

func (b ByteSize) PBytes() float64

func (ByteSize) String

func (b ByteSize) String() string

func (ByteSize) TBytes

func (b ByteSize) TBytes() float64

func (*ByteSize) UnmarshalText

func (b *ByteSize) UnmarshalText(t []byte) error

Jump to

Keyboard shortcuts

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