data

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 1 Imported by: 20

Documentation

Overview

Package data provides functionality for measuring and displaying data quantities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Size

type Size int64

A Size represents a data quantity in number of bytes.

const (
	B Size = 1 << (10 * iota)
	KiB
	MiB
	GiB
	TiB
	PiB
	EiB
)

Common data quantities.

func (Size) Bytes

func (s Size) Bytes() int64

Bytes returns the size as an integer byte count.

func (Size) Count

func (s Size) Count(u Size) float64

Count returns the number of us in s.

func (Size) String

func (s Size) String() string

String returns a string representation of the data quantity b, picking the largest appropriate unit.

Jump to

Keyboard shortcuts

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