Skip to content

Commit

Permalink
Update fixtures and logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexhauser23 committed Nov 29, 2017
1 parent 819b2a0 commit 8abc087
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
6 changes: 4 additions & 2 deletions backend/repository/client_update.go
Expand Up @@ -173,8 +173,10 @@ func UpdateProductionConfigJSON(req *ClientConfig, productionCfgJSONPath string)
if req.Type == "tchannel" {
content[prefix+"serviceName"] = req.ServiceName
content[prefix+"timeout"] = req.Timeout
content[prefix+"timeoutPerAttempt"] = req.TimeoutPerAttempt,
content[prefix+"routingKey"] = req.routingKey
content[prefix+"timeoutPerAttempt"] = req.TimeoutPerAttempt
if req.RoutingKey != "" {
content[prefix+"routingKey"] = req.RoutingKey
}
}
content[prefix+"port"] = req.Port
content[prefix+"ip"] = req.IP
Expand Down
4 changes: 2 additions & 2 deletions backend/repository/config.go
Expand Up @@ -85,8 +85,8 @@ type ClientConfig struct {
IP string `json:"ip,omitempty"`
Port int64 `json:"port,omitempty"`
Timeout int64 `json:"clientTimeout,omitempty"`
TimeoutPerAttempt int64 `json:"clientTimeoutPerAttempt,omitempty"`,
RoutingKey string `json:"routingKey"`
TimeoutPerAttempt int64 `json:"clientTimeoutPerAttempt,omitempty"`
RoutingKey string `json:"routingKey"`
}

// ThriftService is a service defined in Thrift file.
Expand Down
18 changes: 12 additions & 6 deletions backend/repository/data/gateway_config_expected.json
Expand Up @@ -331,7 +331,8 @@
"TooManyArgs": "Bar::tooManyArgs"
},
"ip": "127.0.0.1",
"port": 4001
"port": 4001,
"routingKey": ""
},
"baz": {
"name": "baz",
Expand Down Expand Up @@ -363,7 +364,8 @@
"ip": "127.0.0.1",
"port": 4002,
"clientTimeout": 10000,
"clientTimeoutPerAttempt": 2000
"clientTimeoutPerAttempt": 2000,
"routingKey": ""
},
"contacts": {
"name": "contacts",
Expand All @@ -373,7 +375,8 @@
"SaveContacts": "Contacts::saveContacts"
},
"ip": "127.0.0.1",
"port": 4000
"port": 4000,
"routingKey": ""
},
"corge": {
"name": "corge",
Expand All @@ -386,7 +389,8 @@
"ip": "127.0.0.1",
"port": 5000,
"clientTimeout": 10000,
"clientTimeoutPerAttempt": 2000
"clientTimeoutPerAttempt": 2000,
"routingKey": ""
},
"google-now": {
"name": "google-now",
Expand All @@ -397,11 +401,13 @@
"CheckCredentials": "GoogleNowService::checkCredentials"
},
"ip": "127.0.0.1",
"port": 14120
"port": 14120,
"routingKey": ""
},
"quux": {
"name": "quux",
"type": "custom"
"type": "custom",
"routingKey": ""
}
},
"ThriftServices": {
Expand Down
19 changes: 19 additions & 0 deletions backend/repository/data/handler/test_cases.json
Expand Up @@ -73,6 +73,7 @@
"ip": "127.0.0.1",
"name": "bar",
"port": 4001,
"routingKey": "",
"thriftFile": "clients/bar/bar.thrift",
"type": "http"
}
Expand Down Expand Up @@ -126,6 +127,7 @@
"ip": "127.0.0.1",
"name": "bar",
"port": 4001,
"routingKey": "",
"thriftFile": "clients/bar/bar.thrift",
"type": "http"
},
Expand Down Expand Up @@ -157,6 +159,7 @@
"ip": "127.0.0.1",
"name": "baz",
"port": 4002,
"routingKey": "",
"serviceName": "Qux",
"thriftFile": "clients/baz/baz.thrift",
"type": "tchannel"
Expand All @@ -168,6 +171,7 @@
"ip": "127.0.0.1",
"name": "contacts",
"port": 4000,
"routingKey": "",
"thriftFile": "clients/contacts/contacts.thrift",
"type": "http"
},
Expand All @@ -180,6 +184,7 @@
"ip": "127.0.0.1",
"name": "corge",
"port": 5000,
"routingKey": "",
"serviceName": "Corge",
"thriftFile": "clients/corge/corge.thrift",
"type": "tchannel"
Expand All @@ -192,11 +197,13 @@
"ip": "127.0.0.1",
"name": "google-now",
"port": 14120,
"routingKey": "",
"thriftFile": "clients/googlenow/googlenow.thrift",
"type": "http"
},
"quux": {
"name": "quux",
"routingKey": "",
"type": "custom"
}
}
Expand Down Expand Up @@ -2270,6 +2277,7 @@
"ip": "127.0.0.1",
"name": "bar",
"port": 4001,
"routingKey": "",
"thriftFile": "clients/bar/bar.thrift",
"type": "http"
},
Expand Down Expand Up @@ -2301,6 +2309,7 @@
"ip": "127.0.0.1",
"name": "baz",
"port": 4002,
"routingKey": "",
"serviceName": "Qux",
"thriftFile": "clients/baz/baz.thrift",
"type": "tchannel"
Expand All @@ -2312,6 +2321,7 @@
"ip": "127.0.0.1",
"name": "contacts",
"port": 4000,
"routingKey": "",
"thriftFile": "clients/contacts/contacts.thrift",
"type": "http"
},
Expand All @@ -2324,6 +2334,7 @@
"ip": "127.0.0.1",
"name": "corge",
"port": 5000,
"routingKey": "",
"serviceName": "Corge",
"thriftFile": "clients/corge/corge.thrift",
"type": "tchannel"
Expand All @@ -2336,11 +2347,13 @@
"ip": "127.0.0.1",
"name": "google-now",
"port": 14120,
"routingKey": "",
"thriftFile": "clients/googlenow/googlenow.thrift",
"type": "http"
},
"quux": {
"name": "quux",
"routingKey": "",
"type": "custom"
}
},
Expand Down Expand Up @@ -3159,6 +3172,7 @@
"ip": "127.0.0.1",
"name": "bar",
"port": 4001,
"routingKey": "",
"thriftFile": "clients/bar/bar.thrift",
"type": "http"
},
Expand Down Expand Up @@ -3190,6 +3204,7 @@
"ip": "127.0.0.1",
"name": "baz",
"port": 4002,
"routingKey": "",
"serviceName": "Qux",
"thriftFile": "clients/baz/baz.thrift",
"type": "tchannel"
Expand All @@ -3201,6 +3216,7 @@
"ip": "127.0.0.1",
"name": "contacts",
"port": 4000,
"routingKey": "",
"thriftFile": "clients/contacts/contacts.thrift",
"type": "http"
},
Expand All @@ -3213,6 +3229,7 @@
"ip": "127.0.0.1",
"name": "corge",
"port": 5000,
"routingKey": "",
"serviceName": "Corge",
"thriftFile": "clients/corge/corge.thrift",
"type": "tchannel"
Expand All @@ -3225,11 +3242,13 @@
"ip": "127.0.0.1",
"name": "google-now",
"port": 14120,
"routingKey": "",
"thriftFile": "clients/googlenow/googlenow.thrift",
"type": "http"
},
"quux": {
"name": "quux",
"routingKey": "",
"type": "custom"
}
},
Expand Down

0 comments on commit 8abc087

Please sign in to comment.