Documentation
¶
Index ¶
- Variables
- type AlgoParams
- func (*AlgoParams) Descriptor() ([]byte, []int)deprecated
- func (x *AlgoParams) GetAlgorithm() Algorithm
- func (x *AlgoParams) GetMurmurSeed() uint32
- func (*AlgoParams) ProtoMessage()
- func (x *AlgoParams) ProtoReflect() protoreflect.Message
- func (x *AlgoParams) Reset()
- func (x *AlgoParams) String() string
- type Algorithm
- type Bucket
- type FairData
- type FairRunParameters
- func (*FairRunParameters) Descriptor() ([]byte, []int)deprecated
- func (x *FairRunParameters) GetAlgoParams() *AlgoParams
- func (*FairRunParameters) ProtoMessage()
- func (x *FairRunParameters) ProtoReflect() protoreflect.Message
- func (x *FairRunParameters) Reset()
- func (x *FairRunParameters) String() string
- type FairRuntimeData
- func (*FairRuntimeData) Descriptor() ([]byte, []int)deprecated
- func (x *FairRuntimeData) GetData() *FairData
- func (x *FairRuntimeData) GetRuntime() *FairRunParameters
- func (*FairRuntimeData) ProtoMessage()
- func (x *FairRuntimeData) ProtoReflect() protoreflect.Message
- func (x *FairRuntimeData) Reset()
- func (x *FairRuntimeData) String() string
- type FairStruct
- func (*FairStruct) Descriptor() ([]byte, []int)deprecated
- func (x *FairStruct) GetCfg() *TrackerCfg
- func (x *FairStruct) GetData() *FairRuntimeData
- func (x *FairStruct) GetMeta() *HostMeta
- func (*FairStruct) ProtoMessage()
- func (x *FairStruct) ProtoReflect() protoreflect.Message
- func (x *FairStruct) Reset()
- func (x *FairStruct) String() string
- type HostMeta
- type Level
- type LevelSquashingFunction
- func (LevelSquashingFunction) Descriptor() protoreflect.EnumDescriptor
- func (x LevelSquashingFunction) Enum() *LevelSquashingFunction
- func (LevelSquashingFunction) EnumDescriptor() ([]byte, []int)deprecated
- func (x LevelSquashingFunction) Number() protoreflect.EnumNumber
- func (x LevelSquashingFunction) String() string
- func (LevelSquashingFunction) Type() protoreflect.EnumType
- type Serializer
- func (s *Serializer) Deserialize(data []byte) (ft *FairStruct, err error)
- func (s *Serializer) DeserializeFromJSON(data []byte) (fst *FairStruct, err error)
- func (s *Serializer) Serialize(fairStruct *FairStruct) (result []byte, err error)
- func (s *Serializer) SerializeToJSON(fairStruct *FairStruct) (stuff []byte, err error)
- type TrackerCfg
- func (*TrackerCfg) Descriptor() ([]byte, []int)deprecated
- func (x *TrackerCfg) GetConfigVersion() uint64
- func (x *TrackerCfg) GetL() uint32
- func (x *TrackerCfg) GetLambda() float64
- func (x *TrackerCfg) GetLevelSquashFn() LevelSquashingFunction
- func (x *TrackerCfg) GetM() uint32
- func (x *TrackerCfg) GetPd() float64
- func (x *TrackerCfg) GetPi() float64
- func (x *TrackerCfg) GetRotationFrequency() *durationpb.Duration
- func (x *TrackerCfg) GetTrackerId() string
- func (*TrackerCfg) ProtoMessage()
- func (x *TrackerCfg) ProtoReflect() protoreflect.Message
- func (x *TrackerCfg) Reset()
- func (x *TrackerCfg) String() string
Constants ¶
This section is empty.
Variables ¶
var ( LevelSquashingFunction_name = map[int32]string{ 0: "LEVEL_SQUASHING_FUNCTION_MIN", 1: "LEVEL_SQUASHING_FUNCTION_MEAN", } LevelSquashingFunction_value = map[string]int32{ "LEVEL_SQUASHING_FUNCTION_MIN": 0, "LEVEL_SQUASHING_FUNCTION_MEAN": 1, } )
Enum value maps for LevelSquashingFunction.
var ( Algorithm_name = map[int32]string{ 0: "MURMURHASH_32", } Algorithm_value = map[string]int32{ "MURMURHASH_32": 0, } )
Enum value maps for Algorithm.
var File_v1_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type AlgoParams ¶
type AlgoParams struct {
Algorithm Algorithm `protobuf:"varint,1,opt,name=algorithm,proto3,enum=fair.data.v1.Algorithm" json:"algorithm,omitempty"`
MurmurSeed uint32 `protobuf:"varint,2,opt,name=murmur_seed,json=murmurSeed,proto3" json:"murmur_seed,omitempty"`
// contains filtered or unexported fields
}
AlgoParams holds the choice of Algorithm and the relevant parameters
func (*AlgoParams) Descriptor
deprecated
func (*AlgoParams) Descriptor() ([]byte, []int)
Deprecated: Use AlgoParams.ProtoReflect.Descriptor instead.
func (*AlgoParams) GetAlgorithm ¶
func (x *AlgoParams) GetAlgorithm() Algorithm
func (*AlgoParams) GetMurmurSeed ¶
func (x *AlgoParams) GetMurmurSeed() uint32
func (*AlgoParams) ProtoMessage ¶
func (*AlgoParams) ProtoMessage()
func (*AlgoParams) ProtoReflect ¶
func (x *AlgoParams) ProtoReflect() protoreflect.Message
func (*AlgoParams) Reset ¶
func (x *AlgoParams) Reset()
func (*AlgoParams) String ¶
func (x *AlgoParams) String() string
type Algorithm ¶
type Algorithm int32
const (
Algorithm_MURMURHASH_32 Algorithm = 0
)
func (Algorithm) Descriptor ¶
func (Algorithm) Descriptor() protoreflect.EnumDescriptor
func (Algorithm) EnumDescriptor
deprecated
func (Algorithm) Number ¶
func (x Algorithm) Number() protoreflect.EnumNumber
func (Algorithm) Type ¶
func (Algorithm) Type() protoreflect.EnumType
type Bucket ¶
type Bucket struct {
Probability float64 `protobuf:"fixed64,1,opt,name=probability,proto3" json:"probability,omitempty"`
LastUpdatedTimeMs uint64 `protobuf:"varint,2,opt,name=last_updated_time_ms,json=lastUpdatedTimeMs,proto3" json:"last_updated_time_ms,omitempty"`
// contains filtered or unexported fields
}
Bucket holds the proability and the last update time
func (*Bucket) Descriptor
deprecated
func (*Bucket) GetLastUpdatedTimeMs ¶
func (*Bucket) GetProbability ¶
func (*Bucket) ProtoMessage ¶
func (*Bucket) ProtoMessage()
func (*Bucket) ProtoReflect ¶
func (x *Bucket) ProtoReflect() protoreflect.Message
type FairData ¶
type FairData struct {
Levels []*Level `protobuf:"bytes,1,rep,name=levels,proto3" json:"levels,omitempty"`
// contains filtered or unexported fields
}
FairData holds the tracking data containing multiple levels (L levels)
func (*FairData) Descriptor
deprecated
func (*FairData) ProtoMessage ¶
func (*FairData) ProtoMessage()
func (*FairData) ProtoReflect ¶
func (x *FairData) ProtoReflect() protoreflect.Message
type FairRunParameters ¶
type FairRunParameters struct {
AlgoParams *AlgoParams `protobuf:"bytes,1,opt,name=algo_params,json=algoParams,proto3" json:"algo_params,omitempty"`
// contains filtered or unexported fields
}
FairRunParameters contains the runtime params with the instance of Fair
func (*FairRunParameters) Descriptor
deprecated
func (*FairRunParameters) Descriptor() ([]byte, []int)
Deprecated: Use FairRunParameters.ProtoReflect.Descriptor instead.
func (*FairRunParameters) GetAlgoParams ¶
func (x *FairRunParameters) GetAlgoParams() *AlgoParams
func (*FairRunParameters) ProtoMessage ¶
func (*FairRunParameters) ProtoMessage()
func (*FairRunParameters) ProtoReflect ¶
func (x *FairRunParameters) ProtoReflect() protoreflect.Message
func (*FairRunParameters) Reset ¶
func (x *FairRunParameters) Reset()
func (*FairRunParameters) String ¶
func (x *FairRunParameters) String() string
type FairRuntimeData ¶
type FairRuntimeData struct {
Runtime *FairRunParameters `protobuf:"bytes,1,opt,name=runtime,proto3" json:"runtime,omitempty"`
Data *FairData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
// contains filtered or unexported fields
}
Holds the parameters and the associated data
func (*FairRuntimeData) Descriptor
deprecated
func (*FairRuntimeData) Descriptor() ([]byte, []int)
Deprecated: Use FairRuntimeData.ProtoReflect.Descriptor instead.
func (*FairRuntimeData) GetData ¶
func (x *FairRuntimeData) GetData() *FairData
func (*FairRuntimeData) GetRuntime ¶
func (x *FairRuntimeData) GetRuntime() *FairRunParameters
func (*FairRuntimeData) ProtoMessage ¶
func (*FairRuntimeData) ProtoMessage()
func (*FairRuntimeData) ProtoReflect ¶
func (x *FairRuntimeData) ProtoReflect() protoreflect.Message
func (*FairRuntimeData) Reset ¶
func (x *FairRuntimeData) Reset()
func (*FairRuntimeData) String ¶
func (x *FairRuntimeData) String() string
type FairStruct ¶
type FairStruct struct {
Cfg *TrackerCfg `protobuf:"bytes,1,opt,name=cfg,proto3" json:"cfg,omitempty"`
Data *FairRuntimeData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
Meta *HostMeta `protobuf:"bytes,3,opt,name=meta,proto3" json:"meta,omitempty"`
// contains filtered or unexported fields
}
FairStruct - wraps up the config, parameters and the data associated with a Fair Tracker
func (*FairStruct) Descriptor
deprecated
func (*FairStruct) Descriptor() ([]byte, []int)
Deprecated: Use FairStruct.ProtoReflect.Descriptor instead.
func (*FairStruct) GetCfg ¶
func (x *FairStruct) GetCfg() *TrackerCfg
func (*FairStruct) GetData ¶
func (x *FairStruct) GetData() *FairRuntimeData
func (*FairStruct) GetMeta ¶
func (x *FairStruct) GetMeta() *HostMeta
func (*FairStruct) ProtoMessage ¶
func (*FairStruct) ProtoMessage()
func (*FairStruct) ProtoReflect ¶
func (x *FairStruct) ProtoReflect() protoreflect.Message
func (*FairStruct) Reset ¶
func (x *FairStruct) Reset()
func (*FairStruct) String ¶
func (x *FairStruct) String() string
type HostMeta ¶
type HostMeta struct {
HostGuid string `protobuf:"bytes,1,opt,name=host_guid,json=hostGuid,proto3" json:"host_guid,omitempty"`
SerializedAtMs uint64 `protobuf:"varint,2,opt,name=serialized_at_ms,json=serializedAtMs,proto3" json:"serialized_at_ms,omitempty"`
// contains filtered or unexported fields
}
Metadata to uniquely identify a host
func (*HostMeta) Descriptor
deprecated
func (*HostMeta) GetHostGuid ¶
func (*HostMeta) GetSerializedAtMs ¶
func (*HostMeta) ProtoMessage ¶
func (*HostMeta) ProtoMessage()
func (*HostMeta) ProtoReflect ¶
func (x *HostMeta) ProtoReflect() protoreflect.Message
type Level ¶
type Level struct {
Buckets []*Bucket `protobuf:"bytes,1,rep,name=buckets,proto3" json:"buckets,omitempty"`
// contains filtered or unexported fields
}
Each level holds an array of Buckets (M Buckets)
func (*Level) Descriptor
deprecated
func (*Level) GetBuckets ¶
func (*Level) ProtoMessage ¶
func (*Level) ProtoMessage()
func (*Level) ProtoReflect ¶
func (x *Level) ProtoReflect() protoreflect.Message
type LevelSquashingFunction ¶
type LevelSquashingFunction int32
Controls how we arrive at the final probability from all the buckets at a level
const ( LevelSquashingFunction_LEVEL_SQUASHING_FUNCTION_MIN LevelSquashingFunction = 0 LevelSquashingFunction_LEVEL_SQUASHING_FUNCTION_MEAN LevelSquashingFunction = 1 )
func (LevelSquashingFunction) Descriptor ¶
func (LevelSquashingFunction) Descriptor() protoreflect.EnumDescriptor
func (LevelSquashingFunction) Enum ¶
func (x LevelSquashingFunction) Enum() *LevelSquashingFunction
func (LevelSquashingFunction) EnumDescriptor
deprecated
func (LevelSquashingFunction) EnumDescriptor() ([]byte, []int)
Deprecated: Use LevelSquashingFunction.Descriptor instead.
func (LevelSquashingFunction) Number ¶
func (x LevelSquashingFunction) Number() protoreflect.EnumNumber
func (LevelSquashingFunction) String ¶
func (x LevelSquashingFunction) String() string
func (LevelSquashingFunction) Type ¶
func (LevelSquashingFunction) Type() protoreflect.EnumType
type Serializer ¶
type Serializer struct{}
Serializer handles serialization and deserialization of FairStruct
func NewSerializer ¶
func NewSerializer() *Serializer
NewSerializer creates a new serializer instance
func (*Serializer) Deserialize ¶
func (s *Serializer) Deserialize(data []byte) (ft *FairStruct, err error)
Deserialize converts bytes back to a FairStruct
func (*Serializer) DeserializeFromJSON ¶
func (s *Serializer) DeserializeFromJSON(data []byte) (fst *FairStruct, err error)
DeserializeFromJSON converts JSON bytes back to a FairStruct
func (*Serializer) Serialize ¶
func (s *Serializer) Serialize(fairStruct *FairStruct) (result []byte, err error)
Serialize converts a FairStruct to bytes
func (*Serializer) SerializeToJSON ¶
func (s *Serializer) SerializeToJSON(fairStruct *FairStruct) (stuff []byte, err error)
SerializeToJSON converts a FairStruct to JSON bytes
type TrackerCfg ¶
type TrackerCfg struct {
// Unique ID per tracker config
TrackerId string `protobuf:"bytes,1,opt,name=tracker_id,json=trackerId,proto3" json:"tracker_id,omitempty"`
// Version the tracker config
ConfigVersion uint64 `protobuf:"varint,2,opt,name=config_version,json=configVersion,proto3" json:"config_version,omitempty"`
// Number of buckets per level
M uint32 `protobuf:"varint,3,opt,name=m,proto3" json:"m,omitempty"`
// Number of levels per tracker
L uint32 `protobuf:"varint,4,opt,name=l,proto3" json:"l,omitempty"`
// Increment probability used on failed requests
Pi float64 `protobuf:"fixed64,5,opt,name=pi,proto3" json:"pi,omitempty"`
// Decrement probability used on successfull requests
Pd float64 `protobuf:"fixed64,6,opt,name=pd,proto3" json:"pd,omitempty"`
// Deacy rate for bucket proabilities
Lambda float64 `protobuf:"fixed64,7,opt,name=lambda,proto3" json:"lambda,omitempty"`
// Controls how often the internal structures are rotated
RotationFrequency *durationpb.Duration `protobuf:"bytes,8,opt,name=rotation_frequency,json=rotationFrequency,proto3" json:"rotation_frequency,omitempty"`
// Controls the logic for arriving at the final probability from all the buckets at a level
LevelSquashFn LevelSquashingFunction `` /* 144-byte string literal not displayed */
// contains filtered or unexported fields
}
TrackerCfg contains all the configurations related to a tracker
func (*TrackerCfg) Descriptor
deprecated
func (*TrackerCfg) Descriptor() ([]byte, []int)
Deprecated: Use TrackerCfg.ProtoReflect.Descriptor instead.
func (*TrackerCfg) GetConfigVersion ¶
func (x *TrackerCfg) GetConfigVersion() uint64
func (*TrackerCfg) GetL ¶
func (x *TrackerCfg) GetL() uint32
func (*TrackerCfg) GetLambda ¶
func (x *TrackerCfg) GetLambda() float64
func (*TrackerCfg) GetLevelSquashFn ¶
func (x *TrackerCfg) GetLevelSquashFn() LevelSquashingFunction
func (*TrackerCfg) GetM ¶
func (x *TrackerCfg) GetM() uint32
func (*TrackerCfg) GetPd ¶
func (x *TrackerCfg) GetPd() float64
func (*TrackerCfg) GetPi ¶
func (x *TrackerCfg) GetPi() float64
func (*TrackerCfg) GetRotationFrequency ¶
func (x *TrackerCfg) GetRotationFrequency() *durationpb.Duration
func (*TrackerCfg) GetTrackerId ¶
func (x *TrackerCfg) GetTrackerId() string
func (*TrackerCfg) ProtoMessage ¶
func (*TrackerCfg) ProtoMessage()
func (*TrackerCfg) ProtoReflect ¶
func (x *TrackerCfg) ProtoReflect() protoreflect.Message
func (*TrackerCfg) Reset ¶
func (x *TrackerCfg) Reset()
func (*TrackerCfg) String ¶
func (x *TrackerCfg) String() string