Documentation ¶
Index ¶
- Variables
- type FractionalPercent
- func (*FractionalPercent) Descriptor() ([]byte, []int)
- func (this *FractionalPercent) Equal(that interface{}) bool
- func (m *FractionalPercent) GetDenominator() FractionalPercent_DenominatorType
- func (m *FractionalPercent) GetNumerator() uint32
- func (m *FractionalPercent) Hash(hasher hash.Hash64) (uint64, error)
- func (*FractionalPercent) ProtoMessage()
- func (m *FractionalPercent) Reset()
- func (m *FractionalPercent) String() string
- func (m *FractionalPercent) XXX_DiscardUnknown()
- func (m *FractionalPercent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FractionalPercent) XXX_Merge(src proto.Message)
- func (m *FractionalPercent) XXX_Size() int
- func (m *FractionalPercent) XXX_Unmarshal(b []byte) error
- type FractionalPercent_DenominatorType
- type Percent
- func (*Percent) Descriptor() ([]byte, []int)
- func (this *Percent) Equal(that interface{}) bool
- func (m *Percent) GetValue() float64
- func (m *Percent) Hash(hasher hash.Hash64) (uint64, error)
- func (*Percent) ProtoMessage()
- func (m *Percent) Reset()
- func (m *Percent) String() string
- func (m *Percent) XXX_DiscardUnknown()
- func (m *Percent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Percent) XXX_Merge(src proto.Message)
- func (m *Percent) XXX_Size() int
- func (m *Percent) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var FractionalPercent_DenominatorType_name = map[int32]string{
0: "HUNDRED",
1: "TEN_THOUSAND",
2: "MILLION",
}
View Source
var FractionalPercent_DenominatorType_value = map[string]int32{
"HUNDRED": 0,
"TEN_THOUSAND": 1,
"MILLION": 2,
}
Functions ¶
This section is empty.
Types ¶
type FractionalPercent ¶
type FractionalPercent struct { // Specifies the numerator. Defaults to 0. Numerator uint32 `protobuf:"varint,1,opt,name=numerator,proto3" json:"numerator,omitempty"` // Specifies the denominator. If the denominator specified is less than the numerator, the final // fractional percentage is capped at 1 (100%). Denominator FractionalPercent_DenominatorType `` /* 126-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
A fractional percentage is used in cases in which for performance reasons performing floating point to integer conversions during randomness calculations is undesirable. The message includes both a numerator and denominator that together determine the final fractional value.
* **Example**: 1/100 = 1%. * **Example**: 3/10000 = 0.03%.
func (*FractionalPercent) Descriptor ¶
func (*FractionalPercent) Descriptor() ([]byte, []int)
func (*FractionalPercent) Equal ¶
func (this *FractionalPercent) Equal(that interface{}) bool
func (*FractionalPercent) GetDenominator ¶
func (m *FractionalPercent) GetDenominator() FractionalPercent_DenominatorType
func (*FractionalPercent) GetNumerator ¶
func (m *FractionalPercent) GetNumerator() uint32
func (*FractionalPercent) Hash ¶ added in v0.11.14
func (m *FractionalPercent) Hash(hasher hash.Hash64) (uint64, error)
Hash function
func (*FractionalPercent) ProtoMessage ¶
func (*FractionalPercent) ProtoMessage()
func (*FractionalPercent) Reset ¶
func (m *FractionalPercent) Reset()
func (*FractionalPercent) String ¶
func (m *FractionalPercent) String() string
func (*FractionalPercent) XXX_DiscardUnknown ¶
func (m *FractionalPercent) XXX_DiscardUnknown()
func (*FractionalPercent) XXX_Marshal ¶
func (m *FractionalPercent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*FractionalPercent) XXX_Merge ¶
func (m *FractionalPercent) XXX_Merge(src proto.Message)
func (*FractionalPercent) XXX_Size ¶
func (m *FractionalPercent) XXX_Size() int
func (*FractionalPercent) XXX_Unmarshal ¶
func (m *FractionalPercent) XXX_Unmarshal(b []byte) error
type FractionalPercent_DenominatorType ¶
type FractionalPercent_DenominatorType int32
Fraction percentages support several fixed denominator values.
const ( // 100. // // **Example**: 1/100 = 1%. FractionalPercent_HUNDRED FractionalPercent_DenominatorType = 0 // 10,000. // // **Example**: 1/10000 = 0.01%. FractionalPercent_TEN_THOUSAND FractionalPercent_DenominatorType = 1 // 1,000,000. // // **Example**: 1/1000000 = 0.0001%. FractionalPercent_MILLION FractionalPercent_DenominatorType = 2 )
func (FractionalPercent_DenominatorType) EnumDescriptor ¶
func (FractionalPercent_DenominatorType) EnumDescriptor() ([]byte, []int)
func (FractionalPercent_DenominatorType) String ¶
func (x FractionalPercent_DenominatorType) String() string
type Percent ¶
type Percent struct { Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Identifies a percentage, in the range [0.0, 100.0].
func (*Percent) Descriptor ¶
func (*Percent) ProtoMessage ¶
func (*Percent) ProtoMessage()
func (*Percent) XXX_DiscardUnknown ¶
func (m *Percent) XXX_DiscardUnknown()
func (*Percent) XXX_Marshal ¶
func (*Percent) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.