evaluation

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: ISC Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigCondition

type ConfigCondition struct {
	Type             string                 `json:"type"`
	Operator         string                 `json:"operator"`
	Field            string                 `json:"field"`
	TargetValue      interface{}            `json:"targetValue"`
	AdditionalValues map[string]interface{} `json:"additionalValues"`
}

type ConfigRule

type ConfigRule struct {
	Name           string            `json:"name"`
	ID             string            `json:"id"`
	Salt           string            `json:"salt"`
	PassPercentage float64           `json:"passPercentage"`
	Conditions     []ConfigCondition `json:"conditions"`
	ReturnValue    json.RawMessage   `json:"returnValue"`
}

type ConfigSpec

type ConfigSpec struct {
	Name         string          `json:"name"`
	Type         string          `json:"type"`
	Salt         string          `json:"salt"`
	Enabled      bool            `json:"enabled"`
	Rules        []ConfigRule    `json:"rules"`
	DefaultValue json.RawMessage `json:"defaultValue"`
}

type DownloadConfigSpecResponse

type DownloadConfigSpecResponse struct {
	HasUpdates     bool         `json:"has_updates"`
	Time           int64        `json:"time"`
	FeatureGates   []ConfigSpec `json:"feature_gates"`
	DynamicConfigs []ConfigSpec `json:"dynamic_configs"`
}

type DownloadConfigsInput

type DownloadConfigsInput struct {
	SinceTime       string              `json:"sinceTime"`
	StatsigMetadata net.StatsigMetadata `json:"statsigMetadata"`
}

type EvalResult

type EvalResult struct {
	Pass            bool
	ConfigValue     types.DynamicConfig
	FetchFromServer bool
	Id              string
}

type Evaluator

type Evaluator struct {
	// contains filtered or unexported fields
}

func New

func New(net *net.Net) *Evaluator

func (*Evaluator) CheckGate

func (e *Evaluator) CheckGate(user types.StatsigUser, gateName string) *EvalResult

func (*Evaluator) GetConfig

func (e *Evaluator) GetConfig(user types.StatsigUser, configName string) *EvalResult

func (*Evaluator) Stop

func (e *Evaluator) Stop()

type Store

type Store struct {
	FeatureGates   map[string]ConfigSpec
	DynamicConfigs map[string]ConfigSpec
	// contains filtered or unexported fields
}

func (*Store) StopPolling

func (s *Store) StopPolling()

Jump to

Keyboard shortcuts

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