-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.go
33 lines (28 loc) · 1.01 KB
/
config.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
package random
type dataConfig struct {
dataUrls map[string]string
}
var dconf *dataConfig = func() *dataConfig {
var conf = &dataConfig{dataUrls: map[string]string{}}
conf.setSourcePrefix(sourceUrlPrefix)
return conf
}()
func (dconf *dataConfig) setSourcePrefix(prefix string) {
if prefix[len(prefix)-1] != '/' {
prefix += "/"
}
dconf.dataUrls["area"] = prefix + "area.gob.zst"
dconf.dataUrls["city"] = prefix + "city.gob.zst"
dconf.dataUrls["country"] = prefix + "country.gob.zst"
dconf.dataUrls["emailsuffix"] = prefix + "emailsuffix.gob.zst"
dconf.dataUrls["industry"] = prefix + "industry.gob.zst"
dconf.dataUrls["firstnames"] = prefix + "firstnames.gob.zst"
dconf.dataUrls["lastnames"] = prefix + "lastnames.gob.zst"
dconf.dataUrls["province"] = prefix + "province.gob.zst"
dconf.dataUrls["town"] = prefix + "town.gob.zst"
dconf.dataUrls["ididom"] = prefix + "ididom.gob.zst"
dconf.dataUrls["poetry"] = prefix + "poetry.gob.zst"
}
func ConfigSourcePrefix(prefix string) {
dconf.setSourcePrefix(prefix)
}