Answer architecture round 5: the shipped packages are enus, svse, geose, geous and misc, each holding its files at its root under its manifest's namespace, and the errors use the wording a bench of the Audience chose

This commit is contained in:
2026-10-11 12:15:41 +02:00
committed by Lillem4n
parent 29a76d5d9a
commit 7b70530a8a
152 changed files with 217 additions and 132 deletions
-9
View File
@@ -1,9 +0,0 @@
// 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
@@ -23,5 +23,6 @@
"en_US.version": {"paths":["","n","pre","suffix"]},
"en_US.word": {"paths":[""]}
},
"reads": ["github.com/larvit/fejkdata/data/geo/US"]
"namespace": "en_US",
"reads": ["github.com/larvit/fejkdata/data/geous"]
}
+9
View File
@@ -0,0 +1,9 @@
// Package enus is fejkdata's en_US locale module, whose categories are en_US.*. Its address reads geous's places.
package enus
import "embed"
// FS holds the module's categories and its manifest; pass it to fejkdata.WithDataFS.
//
//go:embed *.json *.tsv .fejkdata.json
var FS embed.FS
-9
View File
@@ -1,9 +0,0 @@
// 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
-9
View File
@@ -1,9 +0,0 @@
// 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
@@ -6,5 +6,6 @@
"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"]}
}
},
"namespace": "geo.SE"
}
+9
View File
@@ -0,0 +1,9 @@
// Package geose is fejkdata's Swedish places module, whose categories are geo.SE.*.
package geose
import "embed"
// FS holds the module's categories and its manifest; pass it to fejkdata.WithDataFS.
//
//go:embed *.json *.tsv .fejkdata.json
var FS embed.FS
@@ -6,5 +6,6 @@
"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"]}
}
},
"namespace": "geo.US"
}
+9
View File
@@ -0,0 +1,9 @@
// Package geous is fejkdata's US places module, whose categories are geo.US.*.
package geous
import "embed"
// FS holds the module's categories and its manifest; pass it to fejkdata.WithDataFS.
//
//go:embed *.json *.tsv .fejkdata.json
var FS embed.FS
+2 -1
View File
@@ -20,5 +20,6 @@
"misc.tld": {"paths":["","tld","type","unicode"]},
"misc.useragent": {"paths":["","browser","device","os","ua"]},
"misc.uuid": {"paths":["","variant"]}
}
},
"namespace": "misc"
}
+3 -3
View File
@@ -1,9 +1,9 @@
// Package misc is fejkdata's misc module.
// Package misc is fejkdata's locale-neutral module, whose categories are misc.*.
package misc
import "embed"
// FS holds the misc categories and the module's manifest; pass it to fejkdata.WithDataFS.
// FS holds the module's categories and its manifest; pass it to fejkdata.WithDataFS.
//
//go:embed misc .fejkdata.json
//go:embed *.json *.tsv .fejkdata.json
var FS embed.FS
+6 -7
View File
@@ -1,20 +1,19 @@
// Package data lists every module fejkdata ships. A module's tree spells its namespace:
// data/geo/SE embeds geo/SE/…, whose categories are geo.SE.*.
// 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/enus"
"github.com/larvit/fejkdata/data/geose"
"github.com/larvit/fejkdata/data/geous"
"github.com/larvit/fejkdata/data/misc"
"github.com/larvit/fejkdata/data/sv_SE"
"github.com/larvit/fejkdata/data/svse"
)
//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}
return []fs.FS{enus.FS, geose.FS, geous.FS, misc.FS, svse.FS}
}
-9
View File
@@ -1,9 +0,0 @@
// 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
@@ -23,5 +23,6 @@
"sv_SE.version": {"paths":["","n","pre","suffix"]},
"sv_SE.word": {"paths":[""]}
},
"reads": ["github.com/larvit/fejkdata/data/geo/SE"]
"namespace": "sv_SE",
"reads": ["github.com/larvit/fejkdata/data/geose"]
}

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