Ship en_US, sv_SE, misc, geo/SE and geo/US as Go packages exporting FS, listed by data.Modules(), and fail a bare New naming WithDataFS

This commit is contained in:
2026-10-10 13:08:01 +02:00
committed by Lillem4n
parent 3368f085fd
commit b8eba1eb35
151 changed files with 377 additions and 232 deletions
-80
View File
@@ -1,80 +0,0 @@
{
"index": {
"en_US.address": {"paths":["","locality","postal-code","region","street","street-number"]},
"en_US.color": {"paths":[""]},
"en_US.company": {"paths":["","base","suffix"]},
"en_US.date": {"paths":[""]},
"en_US.email": {"paths":["","domain","local","local.n"]},
"en_US.first-name": {"parent":"sex","paths":["","count","name","sex"]},
"en_US.ip": {"paths":[""]},
"en_US.itin": {"paths":["","area","group","serial"]},
"en_US.last-name": {"paths":["","count","name"]},
"en_US.person": {"paths":["","first","last","prefix","sex"]},
"en_US.phone": {"paths":["","area","exchange","line"]},
"en_US.phone-exchange": {"paths":[""]},
"en_US.price": {"paths":["","amt","cents"]},
"en_US.sentence": {"paths":["","adj","noun","prep","verb"]},
"en_US.sex": {"paths":["","code","first-name","first-name.count","first-name.name","first-name.sex","name","title","title.name","title.sex","title.share"]},
"en_US.ssn": {"paths":["","area","group","serial"]},
"en_US.time": {"paths":[""]},
"en_US.title": {"parent":"sex","paths":["","name","sex","share"]},
"en_US.url": {"paths":["","host","path"]},
"en_US.username": {"paths":["","n"]},
"en_US.version": {"paths":["","n","pre","suffix"]},
"en_US.word": {"paths":[""]},
"geo.SE.address": {"paths":["","locality","postal-code","street","street-number"]},
"geo.SE.locality": {"parent":"municipality","paths":["","lat","lon","municipality","name","population","postal-code","postal-code.code","postal-code.locality","street","street.locality","street.name","street.segments"]},
"geo.SE.municipality": {"parent":"region","paths":["","code","locality","locality.lat","locality.lon","locality.municipality","locality.name","locality.population","locality.postal-code","locality.postal-code.code","locality.postal-code.locality","locality.street","locality.street.locality","locality.street.name","locality.street.segments","name","population","region"]},
"geo.SE.postal-code": {"parent":"locality","paths":["","code","locality"]},
"geo.SE.region": {"paths":["","code","municipality","municipality.code","municipality.locality","municipality.locality.lat","municipality.locality.lon","municipality.locality.municipality","municipality.locality.name","municipality.locality.population","municipality.locality.postal-code","municipality.locality.postal-code.code","municipality.locality.postal-code.locality","municipality.locality.street","municipality.locality.street.locality","municipality.locality.street.name","municipality.locality.street.segments","municipality.name","municipality.population","municipality.region","name","population","timezone"]},
"geo.SE.street": {"parent":"locality","paths":["","locality","name","segments"]},
"geo.US.address": {"paths":["","locality","postal-code","region","street","street-number"]},
"geo.US.locality": {"parent":"municipality","paths":["","code","lat","lon","municipality","name","population","postal-code","postal-code.addresses","postal-code.code","postal-code.locality","street","street.addresses","street.locality","street.name"]},
"geo.US.municipality": {"parent":"region","paths":["","code","locality","locality.code","locality.lat","locality.lon","locality.municipality","locality.name","locality.population","locality.postal-code","locality.postal-code.addresses","locality.postal-code.code","locality.postal-code.locality","locality.street","locality.street.addresses","locality.street.locality","locality.street.name","name","population","region"]},
"geo.US.postal-code": {"parent":"locality","paths":["","addresses","code","locality"]},
"geo.US.region": {"paths":["","abbr","code","municipality","municipality.code","municipality.locality","municipality.locality.code","municipality.locality.lat","municipality.locality.lon","municipality.locality.municipality","municipality.locality.name","municipality.locality.population","municipality.locality.postal-code","municipality.locality.postal-code.addresses","municipality.locality.postal-code.code","municipality.locality.postal-code.locality","municipality.locality.street","municipality.locality.street.addresses","municipality.locality.street.locality","municipality.locality.street.name","municipality.name","municipality.population","municipality.region","name","population","timezone"]},
"geo.US.street": {"parent":"locality","paths":["","addresses","locality","name"]},
"misc.car": {"paths":["","make","model"]},
"misc.coordinate": {"paths":["","lat","lon"]},
"misc.creditcard": {"paths":["","d"]},
"misc.currency": {"paths":["","code","decimals","name","numeric","symbol"]},
"misc.datetime": {"paths":[""]},
"misc.emoji": {"paths":[""]},
"misc.httpmethod": {"paths":["","idempotent","method","safe"]},
"misc.httpstatus": {"paths":["","code","reason"]},
"misc.language": {"paths":["","code","code3","name"]},
"misc.loglevel": {"paths":["","code","keyword","severity"]},
"misc.mac": {"paths":[""]},
"misc.mimetype": {"paths":["","ext","type"]},
"misc.objectid": {"paths":[""]},
"misc.port": {"paths":["","number","service"]},
"misc.protocol": {"paths":["","keyword","name","number"]},
"misc.territory": {"paths":["","alpha2","alpha3","calling-code","capital","country","currency","flag","languages","name","numeric","timezone","timezone.offset","timezone.territory","timezone.weight","timezone.zone","tld"]},
"misc.timezone": {"parent":"territory","paths":["","offset","territory","weight","zone"]},
"misc.tld": {"paths":["","tld","type","unicode"]},
"misc.useragent": {"paths":["","browser","device","os","ua"]},
"misc.uuid": {"paths":["","variant"]},
"sv_SE.address": {"paths":["","locality","postal-code","street","street-number"]},
"sv_SE.birth-number": {"parent":"sex","paths":["","number","sex"]},
"sv_SE.color": {"paths":[""]},
"sv_SE.company": {"paths":["","base","suffix"]},
"sv_SE.date": {"paths":[""]},
"sv_SE.email": {"paths":["","domain","local","local.n"]},
"sv_SE.first-name": {"parent":"sex","paths":["","count","name","sex"]},
"sv_SE.ip": {"paths":[""]},
"sv_SE.last-name": {"paths":["","count","name"]},
"sv_SE.person": {"paths":["","first","last","prefix","sex"]},
"sv_SE.personnummer": {"paths":[""]},
"sv_SE.phone": {"paths":["","a","b","c","prefix"]},
"sv_SE.price": {"paths":["","amt","ore"]},
"sv_SE.samordningsnummer": {"paths":[""]},
"sv_SE.sentence": {"paths":["","adj","noun","prep","verb"]},
"sv_SE.sex": {"paths":["","birth-number","birth-number.number","birth-number.sex","code","first-name","first-name.count","first-name.name","first-name.sex","name"]},
"sv_SE.time": {"paths":[""]},
"sv_SE.title": {"paths":["","name","share"]},
"sv_SE.url": {"paths":["","host","path"]},
"sv_SE.username": {"paths":["","n"]},
"sv_SE.version": {"paths":["","n","pre","suffix"]},
"sv_SE.word": {"paths":[""]}
}
}
+27
View File
@@ -0,0 +1,27 @@
{
"index": {
"en_US.address": {"paths":["","locality","postal-code","region","street","street-number"]},
"en_US.color": {"paths":[""]},
"en_US.company": {"paths":["","base","suffix"]},
"en_US.date": {"paths":[""]},
"en_US.email": {"paths":["","domain","local","local.n"]},
"en_US.first-name": {"parent":"sex","paths":["","count","name","sex"]},
"en_US.ip": {"paths":[""]},
"en_US.itin": {"paths":["","area","group","serial"]},
"en_US.last-name": {"paths":["","count","name"]},
"en_US.person": {"paths":["","first","last","prefix","sex"]},
"en_US.phone": {"paths":["","area","exchange","line"]},
"en_US.phone-exchange": {"paths":[""]},
"en_US.price": {"paths":["","amt","cents"]},
"en_US.sentence": {"paths":["","adj","noun","prep","verb"]},
"en_US.sex": {"paths":["","code","first-name","first-name.count","first-name.name","first-name.sex","name","title","title.name","title.sex","title.share"]},
"en_US.ssn": {"paths":["","area","group","serial"]},
"en_US.time": {"paths":[""]},
"en_US.title": {"parent":"sex","paths":["","name","sex","share"]},
"en_US.url": {"paths":["","host","path"]},
"en_US.username": {"paths":["","n"]},
"en_US.version": {"paths":["","n","pre","suffix"]},
"en_US.word": {"paths":[""]}
},
"reads": ["github.com/larvit/fejkdata/data/geo/US"]
}
+9
View File
@@ -0,0 +1,9 @@
// Package en_US is fejkdata's en_US locale module.
package en_US
import "embed"
// FS holds the en_US categories and the module's manifest; pass it to fejkdata.WithDataFS.
//
//go:embed en_US .fejkdata.json
var FS embed.FS
+10
View File
@@ -0,0 +1,10 @@
{
"index": {
"geo.SE.address": {"paths":["","locality","postal-code","street","street-number"]},
"geo.SE.locality": {"parent":"municipality","paths":["","lat","lon","municipality","name","population","postal-code","postal-code.code","postal-code.locality","street","street.locality","street.name","street.segments"]},
"geo.SE.municipality": {"parent":"region","paths":["","code","locality","locality.lat","locality.lon","locality.municipality","locality.name","locality.population","locality.postal-code","locality.postal-code.code","locality.postal-code.locality","locality.street","locality.street.locality","locality.street.name","locality.street.segments","name","population","region"]},
"geo.SE.postal-code": {"parent":"locality","paths":["","code","locality"]},
"geo.SE.region": {"paths":["","code","municipality","municipality.code","municipality.locality","municipality.locality.lat","municipality.locality.lon","municipality.locality.municipality","municipality.locality.name","municipality.locality.population","municipality.locality.postal-code","municipality.locality.postal-code.code","municipality.locality.postal-code.locality","municipality.locality.street","municipality.locality.street.locality","municipality.locality.street.name","municipality.locality.street.segments","municipality.name","municipality.population","municipality.region","name","population","timezone"]},
"geo.SE.street": {"parent":"locality","paths":["","locality","name","segments"]}
}
}
+9
View File
@@ -0,0 +1,9 @@
// Package SE is fejkdata's Swedish geography module.
package SE
import "embed"
// FS holds the geo.SE categories and the module's manifest; pass it to fejkdata.WithDataFS.
//
//go:embed geo .fejkdata.json
var FS embed.FS
+10
View File
@@ -0,0 +1,10 @@
{
"index": {
"geo.US.address": {"paths":["","locality","postal-code","region","street","street-number"]},
"geo.US.locality": {"parent":"municipality","paths":["","code","lat","lon","municipality","name","population","postal-code","postal-code.addresses","postal-code.code","postal-code.locality","street","street.addresses","street.locality","street.name"]},
"geo.US.municipality": {"parent":"region","paths":["","code","locality","locality.code","locality.lat","locality.lon","locality.municipality","locality.name","locality.population","locality.postal-code","locality.postal-code.addresses","locality.postal-code.code","locality.postal-code.locality","locality.street","locality.street.addresses","locality.street.locality","locality.street.name","name","population","region"]},
"geo.US.postal-code": {"parent":"locality","paths":["","addresses","code","locality"]},
"geo.US.region": {"paths":["","abbr","code","municipality","municipality.code","municipality.locality","municipality.locality.code","municipality.locality.lat","municipality.locality.lon","municipality.locality.municipality","municipality.locality.name","municipality.locality.population","municipality.locality.postal-code","municipality.locality.postal-code.addresses","municipality.locality.postal-code.code","municipality.locality.postal-code.locality","municipality.locality.street","municipality.locality.street.addresses","municipality.locality.street.locality","municipality.locality.street.name","municipality.name","municipality.population","municipality.region","name","population","timezone"]},
"geo.US.street": {"parent":"locality","paths":["","addresses","locality","name"]}
}
}
+9
View File
@@ -0,0 +1,9 @@
// Package US is fejkdata's US geography module.
package US
import "embed"
// FS holds the geo.US categories and the module's manifest; pass it to fejkdata.WithDataFS.
//
//go:embed geo .fejkdata.json
var FS embed.FS
+24
View File
@@ -0,0 +1,24 @@
{
"index": {
"misc.car": {"paths":["","make","model"]},
"misc.coordinate": {"paths":["","lat","lon"]},
"misc.creditcard": {"paths":["","d"]},
"misc.currency": {"paths":["","code","decimals","name","numeric","symbol"]},
"misc.datetime": {"paths":[""]},
"misc.emoji": {"paths":[""]},
"misc.httpmethod": {"paths":["","idempotent","method","safe"]},
"misc.httpstatus": {"paths":["","code","reason"]},
"misc.language": {"paths":["","code","code3","name"]},
"misc.loglevel": {"paths":["","code","keyword","severity"]},
"misc.mac": {"paths":[""]},
"misc.mimetype": {"paths":["","ext","type"]},
"misc.objectid": {"paths":[""]},
"misc.port": {"paths":["","number","service"]},
"misc.protocol": {"paths":["","keyword","name","number"]},
"misc.territory": {"paths":["","alpha2","alpha3","calling-code","capital","country","currency","flag","languages","name","numeric","timezone","timezone.offset","timezone.territory","timezone.weight","timezone.zone","tld"]},
"misc.timezone": {"parent":"territory","paths":["","offset","territory","weight","zone"]},
"misc.tld": {"paths":["","tld","type","unicode"]},
"misc.useragent": {"paths":["","browser","device","os","ua"]},
"misc.uuid": {"paths":["","variant"]}
}
}
+9
View File
@@ -0,0 +1,9 @@
// Package misc is fejkdata's misc module.
package misc
import "embed"
// FS holds the misc categories and the module's manifest; pass it to fejkdata.WithDataFS.
//
//go:embed misc .fejkdata.json
var FS embed.FS
+19
View File
@@ -0,0 +1,19 @@
// Package data lists every module fejkdata ships.
package data
import (
"io/fs"
"github.com/larvit/fejkdata/data/en_US"
"github.com/larvit/fejkdata/data/geo/SE"
"github.com/larvit/fejkdata/data/geo/US"
"github.com/larvit/fejkdata/data/misc"
"github.com/larvit/fejkdata/data/sv_SE"
)
//go:generate env REGENERATE=1 go test -run ^TestShippedManifestsAreCurrent$ ..
// Modules returns every module fejkdata ships, to pass to fejkdata.WithDataFS.
func Modules() []fs.FS {
return []fs.FS{en_US.FS, SE.FS, US.FS, misc.FS, sv_SE.FS}
}
+27
View File
@@ -0,0 +1,27 @@
{
"index": {
"sv_SE.address": {"paths":["","locality","postal-code","street","street-number"]},
"sv_SE.birth-number": {"parent":"sex","paths":["","number","sex"]},
"sv_SE.color": {"paths":[""]},
"sv_SE.company": {"paths":["","base","suffix"]},
"sv_SE.date": {"paths":[""]},
"sv_SE.email": {"paths":["","domain","local","local.n"]},
"sv_SE.first-name": {"parent":"sex","paths":["","count","name","sex"]},
"sv_SE.ip": {"paths":[""]},
"sv_SE.last-name": {"paths":["","count","name"]},
"sv_SE.person": {"paths":["","first","last","prefix","sex"]},
"sv_SE.personnummer": {"paths":[""]},
"sv_SE.phone": {"paths":["","a","b","c","prefix"]},
"sv_SE.price": {"paths":["","amt","ore"]},
"sv_SE.samordningsnummer": {"paths":[""]},
"sv_SE.sentence": {"paths":["","adj","noun","prep","verb"]},
"sv_SE.sex": {"paths":["","birth-number","birth-number.number","birth-number.sex","code","first-name","first-name.count","first-name.name","first-name.sex","name"]},
"sv_SE.time": {"paths":[""]},
"sv_SE.title": {"paths":["","name","share"]},
"sv_SE.url": {"paths":["","host","path"]},
"sv_SE.username": {"paths":["","n"]},
"sv_SE.version": {"paths":["","n","pre","suffix"]},
"sv_SE.word": {"paths":[""]}
},
"reads": ["github.com/larvit/fejkdata/data/geo/SE"]
}
+9
View File
@@ -0,0 +1,9 @@
// Package sv_SE is fejkdata's sv_SE locale module.
package sv_SE
import "embed"
// FS holds the sv_SE categories and the module's manifest; pass it to fejkdata.WithDataFS.
//
//go:embed sv_SE .fejkdata.json
var FS embed.FS

Some files were not shown because too many files have changed in this diff Show More