This repository has been archived by the owner on Nov 12, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04c4191
commit cb23ed8
Showing
3 changed files
with
32 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,168 +1,31 @@ | ||
// Code generated by tools/generator/generate.go; DO NOT EDIT. | ||
|
||
package regions | ||
|
||
var REGION_DATA = map[string]Region{ | ||
"asia-east1": Region{ | ||
Name: "Taiwan", | ||
Flag: "https://upload.wikimedia.org/wikipedia/commons/7/72/Flag_of_the_Republic_of_China.svg", | ||
Latitude: 23.69781, | ||
Longitude: 120.960515, | ||
}, | ||
"asia-east2": Region{ | ||
Name: "Hong Kong", | ||
Flag: "https://upload.wikimedia.org/wikipedia/commons/5/5b/Flag_of_Hong_Kong.svg", | ||
Latitude: 22.396428, | ||
Longitude: 114.109497, | ||
}, | ||
"asia-northeast1": Region{ | ||
Name: "Tokyo", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/9/9e/Flag_of_Japan.svg", | ||
Latitude: 35.6762, | ||
Longitude: 139.6503, | ||
}, | ||
"asia-northeast2": Region{ | ||
Name: "Osaka", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/9/9e/Flag_of_Japan.svg", | ||
Latitude: 34.6937, | ||
Longitude: 135.5023, | ||
}, | ||
"asia-northeast3": Region{ | ||
Name: "Seoul", | ||
Flag: "https://upload.wikimedia.org/wikipedia/commons/0/09/Flag_of_South_Korea.svg", | ||
Latitude: 37.5665, | ||
Longitude: 126.978, | ||
}, | ||
"asia-south1": Region{ | ||
Name: "Delhi", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/4/41/Flag_of_India.svg", | ||
Latitude: 19.076, | ||
Longitude: 72.8777, | ||
}, | ||
"asia-south2": Region{ | ||
Name: "Mumbai", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/4/41/Flag_of_India.svg", | ||
Latitude: 28.7041, | ||
Longitude: 77.1025, | ||
}, | ||
"asia-southeast1": Region{ | ||
Name: "Singapore", | ||
Flag: "https://upload.wikimedia.org/wikipedia/commons/4/48/Flag_of_Singapore.svg", | ||
Latitude: 1.3521, | ||
Longitude: 103.8198, | ||
}, | ||
"asia-southeast2": Region{ | ||
Name: "Jakarta", | ||
Flag: "https://upload.wikimedia.org/wikipedia/commons/9/9f/Flag_of_Indonesia.svg", | ||
Latitude: -6.2088, | ||
Longitude: 106.8456, | ||
}, | ||
"australia-southeast1": Region{ | ||
Name: "Sydney", | ||
Flag: "https://upload.wikimedia.org/wikipedia/commons/8/88/Flag_of_Australia_%28converted%29.svg", | ||
Latitude: -33.8688, | ||
Longitude: 151.2093, | ||
}, | ||
"australia-southeast2": Region{ | ||
Name: "Melbourne", | ||
Flag: "https://upload.wikimedia.org/wikipedia/commons/8/88/Flag_of_Australia_%28converted%29.svg", | ||
Latitude: -37.8136, | ||
Longitude: 144.9631, | ||
}, | ||
"europe-central2": Region{ | ||
Name: "Warsaw, Poland", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/1/12/Flag_of_Poland.svg", | ||
Latitude: 52.2297, | ||
Longitude: 21.0122, | ||
}, | ||
"europe-north1": Region{ | ||
Name: "Hamina, Finland", | ||
Flag: "https://upload.wikimedia.org/wikipedia/commons/b/bc/Flag_of_Finland.svg", | ||
Latitude: 60.5693, | ||
Longitude: 27.1878, | ||
}, | ||
"europe-west1": Region{ | ||
Name: "Belgium", | ||
Flag: "https://upload.wikimedia.org/wikipedia/commons/9/92/Flag_of_Belgium_%28civil%29.svg", | ||
Latitude: 50.5039, | ||
Longitude: 4.4699, | ||
}, | ||
"europe-west2": Region{ | ||
Name: "London, UK", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/a/ae/Flag_of_the_United_Kingdom.svg", | ||
Latitude: 51.5074, | ||
Longitude: -0.1278, | ||
}, | ||
"europe-west3": Region{ | ||
Name: "Frankfurt, Germany", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/b/ba/Flag_of_Germany.svg", | ||
Latitude: 50.1109, | ||
Longitude: 8.6821, | ||
}, | ||
"europe-west4": Region{ | ||
Name: "Netherlands", | ||
Flag: "https://upload.wikimedia.org/wikipedia/commons/2/20/Flag_of_the_Netherlands.svg", | ||
Latitude: 52.1326, | ||
Longitude: 5.2913, | ||
}, | ||
"europe-west6": Region{ | ||
Name: "Zurich, Switzerland", | ||
Flag: "https://upload.wikimedia.org/wikipedia/commons/f/f3/Flag_of_Switzerland.svg", | ||
Latitude: 47.3769, | ||
Longitude: 8.5417, | ||
}, | ||
"northamerica-northeast1": Region{ | ||
Name: "Montréal, Canada", | ||
Flag: "https://upload.wikimedia.org/wikipedia/commons/d/d9/Flag_of_Canada_%28Pantone%29.svg", | ||
Latitude: 45.5017, | ||
Longitude: -73.5673, | ||
}, | ||
"southamerica-east1": Region{ | ||
Name: "São Paulo", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/0/05/Flag_of_Brazil.svg", | ||
Latitude: -23.5505, | ||
Longitude: -46.6333, | ||
}, | ||
"us-central1": Region{ | ||
Name: "Iowa, USA", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/a/a4/Flag_of_the_United_States.svg", | ||
Latitude: 41.878, | ||
Longitude: -93.0977, | ||
}, | ||
"us-east1": Region{ | ||
Name: "South Carolina, USA", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/a/a4/Flag_of_the_United_States.svg", | ||
Latitude: 33.8361, | ||
Longitude: -81.1637, | ||
}, | ||
"us-east4": Region{ | ||
Name: "Northern Virginia, USA", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/a/a4/Flag_of_the_United_States.svg", | ||
Latitude: 38.8334, | ||
Longitude: -77.2365, | ||
}, | ||
"us-west1": Region{ | ||
Name: "Oregon, USA", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/a/a4/Flag_of_the_United_States.svg", | ||
Latitude: 43.8041, | ||
Longitude: -120.5542, | ||
}, | ||
"us-west2": Region{ | ||
Name: "Los Angeles, USA", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/a/a4/Flag_of_the_United_States.svg", | ||
Latitude: 34.0522, | ||
Longitude: -118.2437, | ||
}, | ||
"us-west3": Region{ | ||
Name: "Salt Lake City, USA", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/a/a4/Flag_of_the_United_States.svg", | ||
Latitude: 40.7608, | ||
Longitude: -111.891, | ||
}, | ||
"us-west4": Region{ | ||
Name: "Las Vegas, USA", | ||
Flag: "https://upload.wikimedia.org/wikipedia/en/a/a4/Flag_of_the_United_States.svg", | ||
Latitude: 36.1699, | ||
Longitude: -115.1398, | ||
}, | ||
var REGIONS = []string{ | ||
"asia-east1", | ||
"asia-east2", | ||
"asia-northeast1", | ||
"asia-northeast2", | ||
"asia-northeast3", | ||
"asia-south1", | ||
"asia-south2", | ||
"asia-southeast1", | ||
"asia-southeast2", | ||
"australia-southeast1", | ||
"australia-southeast2", | ||
"europe-central2", | ||
"europe-north1", | ||
"europe-west1", | ||
"europe-west2", | ||
"europe-west3", | ||
"europe-west4", | ||
"europe-west6", | ||
"northamerica-northeast1", | ||
"southamerica-east1", | ||
"us-central1", | ||
"us-east1", | ||
"us-east4", | ||
"us-west1", | ||
"us-west2", | ||
"us-west3", | ||
"us-west4", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
package regions | ||
|
||
func IsValid(name string) bool { | ||
if _, ok := REGION_DATA[name]; ok { | ||
return true | ||
for _, r := range REGIONS { | ||
if r == name { | ||
return true | ||
} | ||
} | ||
return false | ||
} |