{"modulePath":"github.com/github/git-sizer","version":"v1.6.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package counts\n\n## Variables\n\n```go\nvar Binary = Humaner{\n\t// contains filtered or unexported fields\n}\n```\nBinary is a Humaner representing power-of-1024 based prefixes, typically used for bytes.\n\n```go\nvar Metric = Humaner{\n\t// contains filtered or unexported fields\n}\n```\nMetric is a Humaner representing metric prefixes.\n\n## Types\n\n```go\ntype Count32 uint32\n```\nCount32 is a count of something, capped at math.MaxUint32.\n\n```go\nfunc NewCount32(n uint64) Count32\n```\nNewCount32 initializes a Count32 from a uint64, capped at math.MaxUint32.\n\n```go\nfunc (n1 *Count32) AdjustMaxIfNecessary(n2 Count32) bool\n```\nAdjustMaxIfNecessary adjusts \\`\\*n1\\` to be \\`max(\\*n1, n2)\\`. Return true iff \\`n2\\` was greater than \\`\\*n1\\`.\n\n```go\nfunc (n1 *Count32) AdjustMaxIfPossible(n2 Count32) bool\n```\nAdjustMaxIfPossible adjusts \\`\\*n1\\` to be \\`max(\\*n1, n2)\\`. Return true iff \\`n2\\` was greater than or equal to \\`\\*n1\\`.\n\n```go\nfunc (n1 *Count32) Increment(n2 Count32)\n```\nIncrement increases \\`\\*n1\\` by \\`n2\\`, capped at math.MaxUint32.\n\n```go\nfunc (n1 Count32) Plus(n2 Count32) Count32\n```\nPlus returns the sum of two Count32s, capped at math.MaxUint32.\n\n```go\nfunc (n Count32) ToUint64() (uint64, bool)\n```\nToUint64 returns the value of \\`n\\` as a \\`uint64\\`. If the value has overflowed, it returns \\`(math.MaxUint32, true)\\`.\n\n```go\ntype Count64 uint64\n```\nCount64 is a count of something, capped at math.MaxUint64.\n\n```go\nfunc NewCount64(n uint64) Count64\n```\nNewCount64 initializes a Count64 from a uint64.\n\n```go\nfunc (n1 *Count64) AdjustMaxIfNecessary(n2 Count64) bool\n```\nAdjustMaxIfNecessary adjusts \\`\\*n1\\` to be \\`max(\\*n1, n2)\\`. Return true iff \\`n2\\` was greater than \\`\\*n1\\`.\n\n```go\nfunc (n1 *Count64) AdjustMaxIfPossible(n2 Count64) bool\n```\nAdjustMaxIfPossible adjusts \\`\\*n1\\` to be \\`max(\\*n1, n2)\\`. Return true iff \\`n2\\` was greater than or equal to \\`\\*n1\\`.\n\n```go\nfunc (n1 *Count64) Increment(n2 Count64)\n```\nIncrement increases \\`\\*n1\\` by \\`n2\\`, capped at math.MaxUint64.\n\n```go\nfunc (n1 Count64) Plus(n2 Count64) Count64\n```\nPlus returns the sum of two Count64s, capped at math.MaxUint64.\n\n```go\nfunc (n Count64) ToUint64() (uint64, bool)\n```\nToUint64 returns the value of \\`n\\` as a \\`uint64\\`. If the value has overflowed, it returns \\`(math.MaxUint64, true)\\`.\n\n```go\ntype Humanable interface {\n\t// ToUint64 returns the value as a uint64, and a boolean telling\n\t// whether it overflowed.\n\tToUint64() (uint64, bool)\n}\n```\nHumanable is a quantity that can be made human-readable using \\`Humaner.Format()\\`.\n\n```go\ntype Humaner struct {\n\t// contains filtered or unexported fields\n}\n```\nHumaner is an object that can format a Humanable in human-readable format.\n\n```go\nfunc (h *Humaner) Format(value Humanable, unit string) (numeral string, unitString string)\n```\nFormat formats values, aligned, in \\`len(unit) + 10\\` or fewer characters (except for extremely large numbers). It returns strings representing the numeral and the unit string.\n\n```go\nfunc (h *Humaner) FormatNumber(n uint64, unit string) (numeral string, unitString string)\n```\nFormatNumber formats n, aligned, in \\`len(unit) + 10\\` or fewer characters (except for extremely large numbers). It returns strings representing the numeral and the unit string.\n\n```go\nfunc (h *Humaner) Name() string\n```\nName returns the name of \\`h\\` (\"metric\" or \"binary\").\n\n```go\ntype Prefix struct {\n\tName       string\n\tMultiplier uint64\n}\n```\nPrefix is a metric-like prefix that implies a scaling factor.\n\n","path":"github.com/github/git-sizer/counts","name":"counts","synopsis":"","isRedistributable":true}
