-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathfeature_rule.go
43 lines (41 loc) · 1.9 KB
/
feature_rule.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package growthbook
import "github.com/growthbook/growthbook-golang/internal/condition"
type FeatureRule struct {
// Optional rule id, reserved for future use
Id string `json:"id"`
// Optional targeting condition
Condition condition.Base `json:"condition"`
// Each item defines a prerequisite where a condition must evaluate against a parent feature's value (identified by id).
// If gate is true, then this is a blocking feature-level prerequisite; otherwise it applies to the current rule only.
ParentConditions []ParentCondition `json:"parentConditions"`
// What percent of users should be included in the experiment (between 0 and 1, inclusive)
Coverage *float64 `json:"coverage"`
// Immediately force a specific value (ignore every other option besides condition and coverage)
Force FeatureValue `json:"force"`
// Run an experiment (A/B test) and randomly choose between these variations
Variations []FeatureValue `json:"variations"`
// The globally unique tracking key for the experiment (default to the feature key)
Key string `json:"key"`
// How to weight traffic between variations. Must add to 1.
Weights []float64 `json:"weights"`
// Adds the experiment to a namespace
Namespace *Namespace `json:"namespace"`
// What user attribute should be used to assign variations (defaults to id)
HashAttribute string `json:"hashAttribute"`
// The hash version to use (default to 1)
HashVersion int `json:"hashVersion"`
// A more precise version of coverage
Range *BucketRange `json:"range"`
// Ranges for experiment variations
Ranges []BucketRange `json:"ranges"`
// Meta info about the experiment variations
Meta []VariationMeta `json:"meta"`
// Slice of filters to apply to the rule
Filters []Filter `json:"filters"`
// Seed to use for hashing
Seed string `json:"seed"`
//Human-readable name for the experiment
Name string `json:"name"`
// The phase id of the experiment
Phase string `json:"phase"`
}