(provider, endpoint string)
| 170 | } |
| 171 | |
| 172 | func parseRegionFromEndpoint(provider, endpoint string) (string, error) { |
| 173 | region := "" |
| 174 | if provider == "s3" { |
| 175 | region = parseS3RegionCode(endpoint) |
| 176 | if region == "" { |
| 177 | return "", fmt.Errorf("missing region in endpoint: %s", endpoint) |
| 178 | } |
| 179 | } else { |
| 180 | region = DummyRegion |
| 181 | } |
| 182 | return region, nil |
| 183 | } |
| 184 | |
| 185 | func parseS3RegionCode(endpoint string) string { |
| 186 | if endpoint == "" { |
no test coverage detected