datasize

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	B  Size = 1
	KB      = B << 10
	MB      = KB << 10
	GB      = MB << 10
	TB      = GB << 10
	PB      = TB << 10
	EB      = PB << 10
)

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 Size

type Size uint64

func Parse

func Parse[T string | []byte](data T) (size Size)

func (Size) Bytes

func (s Size) Bytes() uint64

func (Size) EBytes

func (s Size) EBytes() float64

func (Size) GBytes

func (s Size) GBytes() float64

func (Size) KBytes

func (s Size) KBytes() float64

func (Size) MBytes

func (s Size) MBytes() float64

func (Size) MachineString

func (s Size) MachineString() string

func (Size) MarshalText

func (s Size) MarshalText() ([]byte, error)

func (Size) PBytes

func (s Size) PBytes() float64

func (Size) String

func (s Size) String() string

func (Size) TBytes

func (s Size) TBytes() float64

func (*Size) UnmarshalText

func (s *Size) UnmarshalText(b []byte)

Jump to

Keyboard shortcuts

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