Yoji SHIDARA
null+****@clear*****
Tue Dec 25 10:32:24 JST 2012
Yoji SHIDARA 2012-12-25 10:32:24 +0900 (Tue, 25 Dec 2012) New Revision: bbade56ed43d529331f0a7ae0407469a8db7cc7a https://github.com/groonga/gcs/commit/bbade56ed43d529331f0a7ae0407469a8db7cc7a Log: Remove arnToEndpoint method Instead, use Endpoint info directly Modified files: lib/client.js Modified: lib/client.js (+1 -17) =================================================================== --- lib/client.js 2012-12-25 09:22:02 +0900 (c24517a) +++ lib/client.js 2012-12-25 10:32:24 +0900 (4c8827a) @@ -84,7 +84,7 @@ Client.prototype = { self.raiseFatalError(error); try { - var endpoint = self.arnToEndpoint(domain[definition.elementName].Arn).split(':'); + var endpoint = domain[definition.elementName].Endpoint.split(':'); var api = self.createService({ domainName: domain.DomainName, domainId: domain.DomainId.replace(new RegExp('/' + domain.DomainName + '$'), ''), @@ -351,10 +351,6 @@ Client.prototype = { }); }, - arnToEndpoint: function(arn) { - return arnToEndpoint(arn, this.host + ':' + this.port); - }, - detectFileFormat: function(path) { var format = path.match(/\.([^\.]+)$/i); var supportedFormats = ['xml', 'json']; @@ -389,16 +385,4 @@ function toValidHostAndPort(hostAndPort) { } Client.toValidHostAndPort = toValidHostAndPort; -function arnToEndpoint(arn, hostAndPort) { - var match = arn.match(/^arn:aws:cs:[^:]+:([^:]+):([^\/]+)\/(.+)$/); - if (!match) - client.raiseFatalError('invalid arn: ' + arn); - - var id = match[1]; - var type = match[2]; - var name = match[3]; - return type + '-' + name + '-' + id + '.' + toValidHostAndPort(hostAndPort); -} -Client.arnToEndpoint = arnToEndpoint; - exports.Client = Client; -------------- next part -------------- HTML����������������������������... Descargar