@@ -16,11 +16,11 @@ import (
16
16
17
17
var (
18
18
client * local.Client
19
- LocalEvaluationConfigDebug = false
20
- LocalEvaluationConfigServerUrl = "https://api.lab.amplitude. com/ "
21
- LocalEvaluationConfigPollInterval = 30
19
+ LocalEvaluationConfigDebug = true
20
+ LocalEvaluationConfigServerUrl = "https://api.lambdatest. com"
21
+ LocalEvaluationConfigPollInterval = 120
22
22
LocalEvaluationConfigPollerRequestTimeout = 10
23
- LocalEvaluationDeploymentKey = ""
23
+ LocalEvaluationDeploymentKey = "server-jAqqJaX3l8PgNiJpcv9j20ywPzANQQFh "
24
24
)
25
25
26
26
type variant struct {
@@ -29,18 +29,20 @@ type variant struct {
29
29
}
30
30
31
31
type UserProperties struct {
32
- OrgId string `json:"org_id,omitempty"`
33
- OrgName string `json:"org_name,omitempty"`
34
- OrgStatus string `json:"org_status,omitempty"`
35
- Username string `json:"username,omitempty"`
36
- Email string `json:"email,omitempty"`
37
- Plan string `json:"plan,omitempty"`
38
- SubscriptionType string `json:"subscription_type,omitempty"`
39
- SubscriptionStatus string `json:"subscription_status,omitempty"`
40
- HubRegion string `json:"hub_region,omitempty"`
32
+ OrgId string `json:"org_id,omitempty"`
33
+ OrgName string `json:"org_name,omitempty"`
34
+ Username string `json:"username,omitempty"`
35
+ UserStatus string `json:"user_status,omitempty"`
36
+ Email string `json:"email,omitempty"`
37
+ Plan string `json:"plan,omitempty"`
38
+ SubscriptionType string `json:"subscription_type,omitempty"`
39
+ HubRegion string `json:"hub_region,omitempty"`
40
+ InfraProvider string `json:"infra_provider,omitempty"`
41
+ TemplateId string `json:"template_id,omitempty"`
41
42
}
42
43
43
44
func init () {
45
+
44
46
err := godotenv .Load ()
45
47
if err != nil {
46
48
fmt .Printf ("No .env file found" )
@@ -65,7 +67,7 @@ func init() {
65
67
}
66
68
}
67
69
68
- func Initialize () error {
70
+ func Initialize () {
69
71
config := local.Config {
70
72
Debug : LocalEvaluationConfigDebug ,
71
73
ServerUrl : LocalEvaluationConfigServerUrl ,
@@ -76,23 +78,22 @@ func Initialize() error {
76
78
err := client .Start ()
77
79
if err != nil {
78
80
err = fmt .Errorf ("unable to create local evaluation client with given config %v with error %s" , config , err .Error ())
79
- return err
81
+ panic ( err )
80
82
}
81
- return nil
82
83
}
83
84
84
85
func fetch (flagName string , user UserProperties ) variant {
85
86
flagKeys := []string {flagName }
86
87
userProp := map [string ]interface {}{
87
- "org_id" : user .OrgId ,
88
- "org_name" : user .OrgName ,
89
- "org_status " : user .OrgStatus ,
90
- "username " : user .Username ,
91
- "email " : user .Email ,
92
- "plan " : user .Plan ,
93
- "subscription_type " : user .SubscriptionType ,
94
- "subscription_status " : user .SubscriptionStatus ,
95
- "hub_region " : user .HubRegion ,
88
+ "org_id" : user .OrgId ,
89
+ "org_name" : user .OrgName ,
90
+ "username " : user .Username ,
91
+ "email " : user .Email ,
92
+ "plan " : user .Plan ,
93
+ "subscription_type " : user .SubscriptionType ,
94
+ "hub_region " : user .HubRegion ,
95
+ "infra_provider " : user .InfraProvider ,
96
+ "template_id " : user .TemplateId ,
96
97
}
97
98
98
99
expUser := experiment.User {
0 commit comments