_type

package
v0.11.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 11 Imported by: 7

Documentation

Index

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 (*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

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) Descriptor() ([]byte, []int)

func (*Percent) Equal

func (this *Percent) Equal(that interface{}) bool

func (*Percent) GetValue

func (m *Percent) GetValue() float64

func (*Percent) Hash added in v0.11.14

func (m *Percent) Hash(hasher hash.Hash64) (uint64, error)

Hash function

func (*Percent) ProtoMessage

func (*Percent) ProtoMessage()

func (*Percent) Reset

func (m *Percent) Reset()

func (*Percent) String

func (m *Percent) String() string

func (*Percent) XXX_DiscardUnknown

func (m *Percent) XXX_DiscardUnknown()

func (*Percent) XXX_Marshal

func (m *Percent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Percent) XXX_Merge

func (m *Percent) XXX_Merge(src proto.Message)

func (*Percent) XXX_Size

func (m *Percent) XXX_Size() int

func (*Percent) XXX_Unmarshal

func (m *Percent) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL