From 56e74239d6b34df8f30ef046f0b0ff4ff0866a71 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Sun, 14 Jun 2015 23:53:32 -0800 Subject: first commit --- .../aws-sdk-go/internal/endpoints/endpoints.go | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints.go (limited to 'Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints.go') diff --git a/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints.go b/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints.go new file mode 100644 index 000000000..12e4fb529 --- /dev/null +++ b/Godeps/_workspace/src/github.com/awslabs/aws-sdk-go/internal/endpoints/endpoints.go @@ -0,0 +1,24 @@ +package endpoints + +//go:generate go run ../model/cli/gen-endpoints/main.go endpoints.json endpoints_map.go + +import "strings" + +func EndpointForRegion(svcName, region string) string { + derivedKeys := []string{ + region + "/" + svcName, + region + "/*", + "*/" + svcName, + "*/*", + } + + for _, key := range derivedKeys { + if val, ok := endpointsMap.Endpoints[key]; ok { + ep := val.Endpoint + ep = strings.Replace(ep, "{region}", region, -1) + ep = strings.Replace(ep, "{service}", svcName, -1) + return ep + } + } + return "" +} -- cgit v1.2.3-1-g7c22