Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Binary = Humaner{ // contains filtered or unexported fields }
var Metric = Humaner{ // contains filtered or unexported fields }
Functions ¶
This section is empty.
Types ¶
type Count32 ¶
type Count32 uint32
A count of something, capped at math.MaxUint32.
func NewCount32 ¶
func (*Count32) AdjustMaxIfNecessary ¶
AdjustMaxIfNecessary adjusts `*n1` to be `max(*n1, n2)`. Return true iff `n2` was greater than `*n1`.
func (*Count32) AdjustMaxIfPossible ¶
AdjustMaxIfPossible adjusts `*n1` to be `max(*n1, n2)`. Return true iff `n2` was greater than or equal to `*n1`.
type Count64 ¶
type Count64 uint64
A count of something, capped at math.MaxUint64.
func NewCount64 ¶
func (*Count64) AdjustMaxIfNecessary ¶
AdjustMaxIfNecessary adjusts `*n1` to be `max(*n1, n2)`. Return true iff `n2` was greater than `*n1`.
func (*Count64) AdjustMaxIfPossible ¶
AdjustMaxIfPossible adjusts `*n1` to be `max(*n1, n2)`. Return true iff `n2` was greater than or equal to `*n1`.
type Humanable ¶ added in v1.3.0
type Humanable interface {
// Return the value as a uint64, and a boolean telling whether it
// overflowed.
ToUint64() (uint64, bool)
}
A quantity that can be made human-readable using Human().
type Humaner ¶
type Humaner struct {
// contains filtered or unexported fields
}
An object that can format a Humanable in human-readable format.
func (*Humaner) Format ¶ added in v1.3.0
Format values, aligned, in `len(unit) + 10` or fewer characters (except for extremely large numbers).
func (*Humaner) FormatNumber ¶ added in v1.3.0
Format n, aligned, in `len(unit) + 10` or fewer characters (except for extremely large numbers).