Versions in this module Expand all Collapse all v1 v1.5.1 Feb 8, 2017 v1.5.0 Oct 23, 2016 Changes in this version + const BinarySI + const DecimalExponent + const DecimalSI + var ErrFormatWrong = errors.New("quantities must match the regular expression '" + splitREString + "'") + var ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + var ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrNumeric = errors.New("unable to parse numeric part of quantity") + var ErrSuffix = errors.New("unable to parse quantity's suffix") + var MaxMilliValue = int64(((1 << 63) - 1) / 1000) + var Zero = int64Amount + func NewQuantityFlagValue(q *Quantity) flag.Value + type CanonicalValue interface + AsCanonicalBase1024Bytes func(out []byte) ([]byte, int32) + AsCanonicalBytes func(out []byte) ([]byte, int32) + type Format string + type Quantity struct + func MustParse(str string) Quantity + func NewMilliQuantity(value int64, format Format) *Quantity + func NewQuantity(value int64, format Format) *Quantity + func NewScaledQuantity(value int64, scale Scale) *Quantity + func ParseQuantity(str string) (Quantity, error) + func QuantityFlag(flagName, defaultValue, description string) *Quantity + func (*Quantity) Descriptor() ([]byte, []int) + func (*Quantity) ProtoMessage() + func (_ Quantity) OpenAPIDefinition() common.OpenAPIDefinition + func (m *Quantity) Marshal() (data []byte, err error) + func (m *Quantity) MarshalTo(data []byte) (int, error) + func (m *Quantity) Reset() + func (m *Quantity) Size() (n int) + func (m *Quantity) Unmarshal(data []byte) error + func (q *Quantity) Add(y Quantity) + func (q *Quantity) AsCanonicalBytes(out []byte) (result []byte, exponent int32) + func (q *Quantity) AsDec() *inf.Dec + func (q *Quantity) AsInt64() (int64, bool) + func (q *Quantity) AsScale(scale Scale) (CanonicalValue, bool) + func (q *Quantity) CanonicalizeBytes(out []byte) (result, suffix []byte) + func (q *Quantity) Cmp(y Quantity) int + func (q *Quantity) CmpInt64(y int64) int + func (q *Quantity) Copy() *Quantity + func (q *Quantity) IsZero() bool + func (q *Quantity) MilliValue() int64 + func (q *Quantity) Neg() + func (q *Quantity) RoundUp(scale Scale) bool + func (q *Quantity) ScaledValue(scale Scale) int64 + func (q *Quantity) Set(value int64) + func (q *Quantity) SetMilli(value int64) + func (q *Quantity) SetScaled(value int64, scale Scale) + func (q *Quantity) Sign() int + func (q *Quantity) String() string + func (q *Quantity) Sub(y Quantity) + func (q *Quantity) ToDec() *Quantity + func (q *Quantity) UnmarshalJSON(value []byte) error + func (q *Quantity) Value() int64 + func (q Quantity) DeepCopy() Quantity + func (q Quantity) MarshalJSON() ([]byte, error) + type Scale int32 + const Exa + const Giga + const Kilo + const Mega + const Micro + const Milli + const Nano + const Peta + const Tera