This repository has been archived by the owner on Nov 29, 2020. It is now read-only.
forked from abh/geodns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
regiongroups.go
83 lines (73 loc) · 1.57 KB
/
regiongroups.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package countries
import (
"log"
)
var RegionGroups = map[string]string{
"us-ak": "us-west",
"us-az": "us-west",
"us-ca": "us-west",
"us-co": "us-west",
"us-hi": "us-west",
"us-id": "us-west",
"us-mt": "us-west",
"us-nm": "us-west",
"us-nv": "us-west",
"us-or": "us-west",
"us-ut": "us-west",
"us-wa": "us-west",
"us-wy": "us-west",
"us-ar": "us-central",
"us-ia": "us-central",
"us-il": "us-central",
"us-in": "us-central",
"us-ks": "us-central",
"us-la": "us-central",
"us-mn": "us-central",
"us-mo": "us-central",
"us-nd": "us-central",
"us-ne": "us-central",
"us-ok": "us-central",
"us-sd": "us-central",
"us-tx": "us-central",
"us-wi": "us-central",
"us-al": "us-east",
"us-ct": "us-east",
"us-dc": "us-east",
"us-de": "us-east",
"us-fl": "us-east",
"us-ga": "us-east",
"us-ky": "us-east",
"us-ma": "us-east",
"us-md": "us-east",
"us-me": "us-east",
"us-mi": "us-east",
"us-ms": "us-east",
"us-nc": "us-east",
"us-nh": "us-east",
"us-nj": "us-east",
"us-ny": "us-east",
"us-oh": "us-east",
"us-pa": "us-east",
"us-ri": "us-east",
"us-sc": "us-east",
"us-tn": "us-east",
"us-va": "us-east",
"us-vt": "us-east",
"us-wv": "us-east",
}
var RegionGroupRegions = map[string][]string{}
func CountryRegionGroup(country, region string) string {
if country != "us" {
return ""
}
if group, ok := RegionGroups[region]; ok {
return group
}
log.Printf("Did not find a region group for '%s'/'%s'", country, region)
return ""
}
func init() {
for ccrc, rg := range RegionGroups {
RegionGroupRegions[rg] = append(RegionGroupRegions[rg], ccrc)
}
}