Skip to content

Commit

Permalink
Merge pull request #104 from chamilaadhi/master
Browse files Browse the repository at this point in the history
Refactor methods
  • Loading branch information
chamilaadhi authored Jun 29, 2018
2 parents 9445884 + 8bc5d77 commit 2a8c6ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import wso2/gateway;

{{#endpointConfig.prodEndpoints}}
endpoint http:Client {{qualifiedServiceName}}_PROD_EP {
url: gateway:retrieveEndPointURL("{{api.name}}.{{api.version}}.prodEndpoints.0", "{{endpointConfig.prodEndpoints.0.endpointUrl}}"){{#equals api.responseCaching "Disabled"}},
url: gateway:retrieveConfig("{{api.name}}.{{api.version}}.prodEndpoints.0", "{{endpointConfig.prodEndpoints.0.endpointUrl}}"){{#equals api.responseCaching "Disabled"}},
cache: { enabled: false }
{{else}},
cache: { isShared: true }
Expand All @@ -25,7 +25,7 @@ endpoint http:Client {{qualifiedServiceName}}_PROD_EP {
{{/endpointConfig.prodEndpoints}}
{{#endpointConfig.sandEndpoints}}
endpoint http:Client {{qualifiedServiceName}}_SAND_EP {
url: gateway:retrieveEndPointURL("{{api.name}}.{{api.version}}.sandEndpoints.0", "{{endpointConfig.sandEndpoints.0.endpointUrl}}"){{#equals api.responseCaching "Disabled"}},
url: gateway:retrieveConfig("{{api.name}}.{{api.version}}.sandEndpoints.0", "{{endpointConfig.sandEndpoints.0.endpointUrl}}"){{#equals api.responseCaching "Disabled"}},
cache: { enabled: false }
{{else}},
cache: { isShared: true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,6 @@ public function rotateFile(string fileName) returns string|error {
}
}
}
public function retrieveEndPointURL(string key, string default) returns string {
return config:getAsString(key, default = default);
}

@Description {value:"Retrieve external configurations defined against a key"}
public function retrieveConfig(string key, string default) returns string {
Expand Down

0 comments on commit 2a8c6ac

Please sign in to comment.