base: github.com/grailbio/base/data Index | Files

package data

import "github.com/grailbio/base/data"

Package data provides functionality for measuring and displaying data quantities.

Index

Package Files

size.go

type Size Uses

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 Uses

func (s Size) Bytes() int64

Bytes returns the size as an integer byte count.

func (Size) Count Uses

func (s Size) Count(u Size) float64

Count returns the number of us in s.

func (Size) String Uses

func (s Size) String() string

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

Package data imports 1 packages (graph) and is imported by 19 packages. Updated 2018-12-08. Refresh now. Tools for package owners.