Answer architecture round 9: each data package exports Modules, a locale's importing its country's geo package as a bench chose, and a namespace mounts a tree through an fs.FS wrapper, so internal/datafiles walks file-system folders alone

This commit is contained in:
2026-10-11 15:05:56 +02:00
committed by Lillem4n
parent d4dee46086
commit d242466859
12 changed files with 207 additions and 53 deletions
+2 -1
View File
@@ -128,7 +128,8 @@ replacement, and each removed path, column or flag.
- The shipped data comes in Go packages, one per module, each exporting `FS`:
`github.com/larvit/fejkdata/data/en_US` (package `enus`), `…/sv_SE` (`svse`), `…/misc`,
`…/geo/SE` (`geose`) and `…/geo/US` (`geous`). `data.Modules()`, from `github.com/larvit/fejkdata/data`, lists every one,
and the CLI carries them all. `New` loads the modules `WithDataFS(modules...)` names and
and the CLI carries them all. Each package's `Modules()` returns its `FS` and every module
it reads: `svse.Modules()` holds the Swedish places too. `New` loads the modules `WithDataFS(modules...)` names and
the folders `WithDataPath` names, and fails, naming `WithDataFS`, where no such option
is given. A manifest's `namespace` mounts its source under a dot path.
- A data source whose root holds a `.fejkdata.json` manifest with an `index` loads each