Documentation ¶
Index ¶
- Variables
- type FractionalPercent
- func (*FractionalPercent) Descriptor() ([]byte, []int)deprecated
- func (m *FractionalPercent) Equal(that interface{}) bool
- func (x *FractionalPercent) GetDenominator() FractionalPercent_DenominatorType
- func (x *FractionalPercent) GetNumerator() uint32
- func (m *FractionalPercent) Hash(hasher hash.Hash64) (uint64, error)
- func (*FractionalPercent) ProtoMessage()
- func (x *FractionalPercent) ProtoReflect() protoreflect.Message
- func (x *FractionalPercent) Reset()
- func (x *FractionalPercent) String() string
- type FractionalPercent_DenominatorType
- func (FractionalPercent_DenominatorType) Descriptor() protoreflect.EnumDescriptor
- func (x FractionalPercent_DenominatorType) Enum() *FractionalPercent_DenominatorType
- func (FractionalPercent_DenominatorType) EnumDescriptor() ([]byte, []int)deprecated
- func (x FractionalPercent_DenominatorType) Number() protoreflect.EnumNumber
- func (x FractionalPercent_DenominatorType) String() string
- func (FractionalPercent_DenominatorType) Type() protoreflect.EnumType
- type Percent
- func (*Percent) Descriptor() ([]byte, []int)deprecated
- func (m *Percent) Equal(that interface{}) bool
- func (x *Percent) GetValue() float64
- func (m *Percent) Hash(hasher hash.Hash64) (uint64, error)
- func (*Percent) ProtoMessage()
- func (x *Percent) ProtoReflect() protoreflect.Message
- func (x *Percent) Reset()
- func (x *Percent) String() string
Constants ¶
This section is empty.
Variables ¶
var ( FractionalPercent_DenominatorType_name = map[int32]string{ 0: "HUNDRED", 1: "TEN_THOUSAND", 2: "MILLION", } FractionalPercent_DenominatorType_value = map[string]int32{ "HUNDRED": 0, "TEN_THOUSAND": 1, "MILLION": 2, } )
Enum value maps for FractionalPercent_DenominatorType.
var File_github_com_solo_io_solo_kit_api_external_envoy_type_percent_proto protoreflect.FileDescriptor
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 `` /* 134-byte string literal not displayed */ // contains filtered or unexported fields }
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
deprecated
func (*FractionalPercent) Descriptor() ([]byte, []int)
Deprecated: Use FractionalPercent.ProtoReflect.Descriptor instead.
func (*FractionalPercent) Equal ¶
func (m *FractionalPercent) Equal(that interface{}) bool
Equal function
func (*FractionalPercent) GetDenominator ¶
func (x *FractionalPercent) GetDenominator() FractionalPercent_DenominatorType
func (*FractionalPercent) GetNumerator ¶
func (x *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) ProtoReflect ¶ added in v0.16.0
func (x *FractionalPercent) ProtoReflect() protoreflect.Message
func (*FractionalPercent) Reset ¶
func (x *FractionalPercent) Reset()
func (*FractionalPercent) String ¶
func (x *FractionalPercent) String() string
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) Descriptor ¶ added in v0.16.0
func (FractionalPercent_DenominatorType) Descriptor() protoreflect.EnumDescriptor
func (FractionalPercent_DenominatorType) Enum ¶ added in v0.16.0
func (x FractionalPercent_DenominatorType) Enum() *FractionalPercent_DenominatorType
func (FractionalPercent_DenominatorType) EnumDescriptor
deprecated
func (FractionalPercent_DenominatorType) EnumDescriptor() ([]byte, []int)
Deprecated: Use FractionalPercent_DenominatorType.Descriptor instead.
func (FractionalPercent_DenominatorType) Number ¶ added in v0.16.0
func (x FractionalPercent_DenominatorType) Number() protoreflect.EnumNumber
func (FractionalPercent_DenominatorType) String ¶
func (x FractionalPercent_DenominatorType) String() string
func (FractionalPercent_DenominatorType) Type ¶ added in v0.16.0
func (FractionalPercent_DenominatorType) Type() protoreflect.EnumType
type Percent ¶
type Percent struct { Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
Identifies a percentage, in the range [0.0, 100.0].
func (*Percent) Descriptor
deprecated
func (*Percent) ProtoMessage ¶
func (*Percent) ProtoMessage()
func (*Percent) ProtoReflect ¶ added in v0.16.0
func (x *Percent) ProtoReflect() protoreflect.Message