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.

              Source Files